mirror of
https://github.com/zoriya/typebox.git
synced 2026-05-26 16:18:24 +00:00
Scheduled Nightly Builds (#488)
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
name: GitHub CI
|
||||
|
||||
name: Build
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
TypeBox:
|
||||
runs-on: ${{ matrix.os }}
|
||||
@@ -12,11 +10,13 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v1
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
|
||||
- name: Install Packages
|
||||
run: npm install
|
||||
|
||||
- name: Build Library
|
||||
run: npm run build
|
||||
- name: Test Library
|
||||
@@ -0,0 +1,30 @@
|
||||
name: Build Nightly
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 18 * * *' # 6pm Daily
|
||||
jobs:
|
||||
TypeBox:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
node: [20.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
|
||||
- name: Install Packages
|
||||
run: npm install
|
||||
|
||||
- name: Install TypeScript Latest
|
||||
run: npm install typescript@latest
|
||||
- name: Build TypeBox
|
||||
run: npm run build
|
||||
|
||||
- name: Install TypeScript Next
|
||||
run: npm install typescript@next
|
||||
- name: Build TypeBox
|
||||
run: npm run build
|
||||
+22
-22
@@ -5,59 +5,59 @@ import { readFileSync } from 'fs'
|
||||
// Clean
|
||||
// -------------------------------------------------------------------------------
|
||||
export async function clean() {
|
||||
await folder('target').delete()
|
||||
await folder('target').delete()
|
||||
}
|
||||
// -------------------------------------------------------------------------------
|
||||
// Format
|
||||
// -------------------------------------------------------------------------------
|
||||
export async function format() {
|
||||
await shell('prettier --no-semi --single-quote --print-width 240 --trailing-comma all --write src test example/index.ts benchmark')
|
||||
await shell('prettier --no-semi --single-quote --print-width 240 --trailing-comma all --write src test example/index.ts benchmark')
|
||||
}
|
||||
// -------------------------------------------------------------------------------
|
||||
// Start
|
||||
// -------------------------------------------------------------------------------
|
||||
export async function start(example = 'index') {
|
||||
await shell(`hammer run example/${example}.ts --dist target/example/${example}`)
|
||||
await shell(`hammer run example/${example}.ts --dist target/example/${example}`)
|
||||
}
|
||||
// -------------------------------------------------------------------------------
|
||||
// Benchmark
|
||||
// -------------------------------------------------------------------------------
|
||||
export async function benchmark() {
|
||||
await compression()
|
||||
await measurement()
|
||||
await compression()
|
||||
await measurement()
|
||||
}
|
||||
// -------------------------------------------------------------------------------
|
||||
// Test
|
||||
// -------------------------------------------------------------------------------
|
||||
export async function test_static() {
|
||||
await shell(`tsc -p test/static/tsconfig.json --noEmit --strict`)
|
||||
await shell(`tsc -p test/static/tsconfig.json --noEmit --strict`)
|
||||
}
|
||||
export async function test_runtime(filter) {
|
||||
await shell(`hammer build ./test/runtime/index.ts --dist target/test/runtime --platform node`)
|
||||
await shell(`mocha target/test/runtime/index.js -g "${filter}"`)
|
||||
export async function test_runtime(filter = '') {
|
||||
await shell(`hammer build ./test/runtime/index.ts --dist target/test/runtime --platform node`)
|
||||
await shell(`mocha target/test/runtime/index.js -g "${filter}"`)
|
||||
}
|
||||
export async function test(filter = '') {
|
||||
await test_static()
|
||||
await test_runtime(filter)
|
||||
await test_static()
|
||||
await test_runtime(filter)
|
||||
}
|
||||
// -------------------------------------------------------------------------------
|
||||
// Build
|
||||
// -------------------------------------------------------------------------------
|
||||
export async function build(target = 'target/build') {
|
||||
await test()
|
||||
await folder(target).delete()
|
||||
await shell(`tsc -p ./src/tsconfig.json --outDir ${target}`)
|
||||
await folder(target).add('package.json')
|
||||
await folder(target).add('readme.md')
|
||||
await folder(target).add('license')
|
||||
await shell(`cd ${target} && npm pack`)
|
||||
await test()
|
||||
await folder(target).delete()
|
||||
await shell(`tsc -p ./src/tsconfig.json --outDir ${target}`)
|
||||
await folder(target).add('package.json')
|
||||
await folder(target).add('readme.md')
|
||||
await folder(target).add('license')
|
||||
await shell(`cd ${target} && npm pack`)
|
||||
}
|
||||
// -------------------------------------------------------------
|
||||
// Publish
|
||||
// -------------------------------------------------------------
|
||||
export async function publish(otp, target = 'target/build') {
|
||||
const { version } = JSON.parse(readFileSync('package.json', 'utf8'))
|
||||
await shell(`cd ${target} && npm publish sinclair-typebox-${version}.tgz --access=public --otp ${otp}`)
|
||||
await shell(`git tag ${version}`)
|
||||
await shell(`git push origin ${version}`)
|
||||
const { version } = JSON.parse(readFileSync('package.json', 'utf8'))
|
||||
await shell(`cd ${target} && npm publish sinclair-typebox-${version}.tgz --access=public --otp ${otp}`)
|
||||
await shell(`git tag ${version}`)
|
||||
await shell(`git push origin ${version}`)
|
||||
}
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@sinclair/typebox",
|
||||
"version": "0.29.1",
|
||||
"version": "0.29.3",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@sinclair/typebox",
|
||||
"version": "0.29.1",
|
||||
"version": "0.29.3",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@sinclair/hammer": "^0.17.1",
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
|
||||
[](https://badge.fury.io/js/%40sinclair%2Ftypebox)
|
||||
[](https://www.npmjs.com/package/%40sinclair%2Ftypebox)
|
||||
[](https://github.com/sinclairzx81/typebox/actions)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://github.com/sinclairzx81/typebox/actions/workflows/build.yml)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user