mirror of
https://github.com/zerotier/zerotier-one-api-spec.git
synced 2026-05-22 16:29:58 -07:00
build: switch to release-it
use wrankles[bot] to create github releases
This commit is contained in:
committed by
Travis LaDuke
parent
ba68ca230b
commit
72f58374e1
@@ -1,7 +1,11 @@
|
||||
name: tag and release
|
||||
name: Release
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
newversion:
|
||||
description: 'npm version {major,minor,patch,premajor,preminor,prepatch,prerelease}'
|
||||
required: true
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
@@ -9,25 +13,38 @@ jobs:
|
||||
version_and_release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
# fetch full history so things like auto-changelog work properly
|
||||
fetch-depth: 0
|
||||
- name: 'Generate token'
|
||||
id: generate_token
|
||||
uses: tibdex/github-app-token@v1
|
||||
with:
|
||||
app_id: ${{ secrets.BOT_APP_ID }}
|
||||
private_key: ${{ secrets.BOT_PRIVATE_KEY }}
|
||||
|
||||
- name: Install zerotier-one
|
||||
run: curl -s https://install.zerotier.com/ | sudo bash
|
||||
- name: 'Checking out code'
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ steps.generate_token.outputs.token }}
|
||||
|
||||
- name: Set auth token
|
||||
run: echo "AUTH_TOKEN=$(sudo cat /var/lib/zerotier-one/authtoken.secret)" >> $GITHUB_ENV
|
||||
- name: 'Setting up Node'
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: 'npm'
|
||||
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
cache: 'npm'
|
||||
- run: npm ci
|
||||
- run: npm run build
|
||||
- run: npm test
|
||||
- run: npm run release
|
||||
env:
|
||||
GH_RELEASE_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: 'Install Node Dependencies'
|
||||
run: npm ci
|
||||
|
||||
- name: 'Build'
|
||||
run: npm run build
|
||||
|
||||
- name: 'Test'
|
||||
run: npm test
|
||||
|
||||
- name: 'git config'
|
||||
run: git config --global user.email "wrankles@zerotier.com" && git config --global user.name "wrankles"
|
||||
|
||||
- name: 'Create Release'
|
||||
run: npm run release -- ${{ github.event.inputs.newversion }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"npm": {
|
||||
"publish": false
|
||||
},
|
||||
"github": {
|
||||
"release": true,
|
||||
"assets": ["tsp-output/@typespec/openapi3/openapi.yaml","tsp-output/@typespec/json-schema/json-schema.json"],
|
||||
"releaseNotes": "npx auto-changelog -p --stdout -u --template https://raw.githubusercontent.com/release-it/release-it/679bd0e2480d2e04aea4f8d5ecc00183dbd60c05/templates/keepachangelog.hbs --starting-version=${latestTag} --ending-version=${tagName}"
|
||||
},
|
||||
"git": {
|
||||
"changelog": "npx auto-changelog -p --stdout --commit-limit false -u --template https://raw.githubusercontent.com/release-it/release-it/679bd0e2480d2e04aea4f8d5ecc00183dbd60c05/templates/keepachangelog.hbs"
|
||||
},
|
||||
"hooks": {
|
||||
"after:bump": ["npm run build", "npx auto-changelog -p"]
|
||||
}
|
||||
}
|
||||
Generated
+3115
-1495
File diff suppressed because it is too large
Load Diff
+4
-8
@@ -11,14 +11,12 @@
|
||||
"pretest": "openapi-typescript tsp-output/@typespec/openapi3/openapi.yaml -o /tmp/schema.ts",
|
||||
"clean": "rm -rf dist tsp-output",
|
||||
"compile": "tsp compile ./main.tsp",
|
||||
"depcheck": "depcheck --ignores=@typespec/json-schema,@typespec/openapi,@typespec/openapi3,@typespec/prettier-plugin-typespec",
|
||||
"depcheck": "depcheck --ignores=@typespec/json-schema,@typespec/openapi,@typespec/openapi3,@typespec/prettier-plugin-typespec,auto-changelog",
|
||||
"format-spec": "tsp format **/*.tsp",
|
||||
"format-code": "prettier --write **/*.ts",
|
||||
"lint:openapi": "redocly lint tsp-output/@typespec/openapi3/openapi.yaml",
|
||||
"lint:code": "eslint .",
|
||||
"gh:tag": "git tag -d v${npm_package_version}; git tag v${npm_package_version}",
|
||||
"release": "npm run gh:tag && git push --tags && gh-release -y -a=tsp-output/@typespec/openapi3/openapi.yaml,tsp-output/@typespec/json-schema/json-schema.json",
|
||||
"version": "auto-changelog -p --template keepachangelog auto-changelog --breaking-pattern 'BREAKING CHANGE:' && git add CHANGELOG.md",
|
||||
"release": "release-it --ci",
|
||||
"variables": "printf 'alias Version = \"%s\";\n' $npm_package_version > variables.tsp",
|
||||
"watch": "run-p watch:*",
|
||||
"watch:compile": "npm run compile -- --watch",
|
||||
@@ -41,15 +39,13 @@
|
||||
"auto-changelog": "^2.4.0",
|
||||
"depcheck": "^1.4.7",
|
||||
"eslint": "^8.56.0",
|
||||
"gh-release": "^7.0.2",
|
||||
"npm-run-all2": "^6.1.1",
|
||||
"openapi-fetch": "^0.8.2",
|
||||
"openapi-typescript": "^7.0.0-next.7",
|
||||
"openapi-typescript-helpers": "^0.0.6",
|
||||
"prettier": "^3.2.5",
|
||||
"typescript": "^5.3.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"release-it": "^17.2.0",
|
||||
"typescript": "^5.3.3",
|
||||
"borp": "^0.9.1",
|
||||
"semver": "^7.6.0",
|
||||
"testcontainers": "^10.8.2"
|
||||
|
||||
Reference in New Issue
Block a user