build: switch to release-it

use wrankles[bot] to create github releases
This commit is contained in:
travisladuke
2024-04-18 12:09:44 -07:00
committed by Travis LaDuke
parent ba68ca230b
commit 72f58374e1
4 changed files with 3172 additions and 1523 deletions
+37 -20
View File
@@ -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 }}
+16
View File
@@ -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"]
}
}
+3115 -1495
View File
File diff suppressed because it is too large Load Diff
+4 -8
View File
@@ -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"