-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use wrankles[bot] to create github releases
- Loading branch information
Showing
4 changed files
with
3,248 additions
and
1,599 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,50 @@ | ||
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 | ||
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: Install zerotier-one | ||
run: curl -s https://install.zerotier.com/ | sudo bash | ||
|
||
- name: Set auth token | ||
run: echo "AUTH_TOKEN=$(sudo cat /var/lib/zerotier-one/authtoken.secret)" >> $GITHUB_ENV | ||
|
||
- 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: '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: 'Checking out code' | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ steps.generate_token.outputs.token }} | ||
|
||
- name: 'Setting up Node' | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: 'npm' | ||
|
||
- 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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] | ||
} | ||
} |
Oops, something went wrong.