Skip to content

Commit 047d90a

Browse files
committed
ci: update github action. avoid branch protection
1 parent 2a6871d commit 047d90a

File tree

3 files changed

+21
-18
lines changed

3 files changed

+21
-18
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
name: npm version && npm publish
1+
name: tag and release
22

33
on:
44
workflow_dispatch:
5-
inputs:
6-
newversion:
7-
description: 'npm version {major,minor,patch}'
8-
required: true
5+
96
permissions:
107
contents: write
118
jobs:
@@ -28,13 +25,9 @@ jobs:
2825
with:
2926
node-version: 18
3027
cache: 'npm'
31-
3228
- run: npm ci
3329
- run: npm run build
3430
- run: npm test
35-
- run: git config --global user.email "[email protected]"
36-
- run: git config --global user.name "travis laduke"
37-
- run: npm version ${{ github.event.inputs.newversion }}
3831
- run: npm run release
3932
env:
4033
GH_RELEASE_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,26 @@ Releases contain the openapi and json-schema files.
3636

3737
Try to use [conventional commit](https://www.conventionalcommits.org/en/v1.0.0/#summary) messages if you want. They will appear in the changelog.
3838

39+
This is a multistep process now due to branch protection.
40+
41+
### Locally, create version:
42+
When main is in a state you'd like to create a new release for:
43+
44+
- create a feature branch off `main`
45+
- `npm version major|minor|patch`
46+
This bumps the version and updates the changelog
47+
- `npm run build`
48+
This is a little chicken and eggy. The build script updates the the spec version based on the npm package version, which just got updated above.
49+
- commit && push
50+
- create PR
51+
- get merged to `main`
52+
53+
### On Github, create release:
3954
- Go into the repo's Github Actions
40-
- Click "npm version && npm publish"
55+
- Click "tag and release"
4156
- Click Run Workflow
42-
- Type "patch", "minor", or "major" and submit
57+
- Run it off `main`
4358

44-
On the CLI you can do:
45-
46-
``` sh
47-
npm version {major,minor,patch}
48-
npm run release
49-
```
5059

5160
The url to the latest release of the openapi spec is: `https://github.com/zerotier/zerotier-one-api-spec/releases/latest/download/openapi.yaml`
5261

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"format-code": "prettier --write **/*.ts",
1717
"lint:openapi": "redocly lint tsp-output/@typespec/openapi3/openapi.yaml",
1818
"lint:code": "eslint .",
19-
"release": "git push --follow-tags && gh-release -y -a=tsp-output/@typespec/openapi3/openapi.yaml,tsp-output/@typespec/json-schema/json-schema.json",
19+
"gh:tag": "git tag -d v${npm_package_version}; git tag v${npm_package_version}",
20+
"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",
2021
"version": "auto-changelog -p --template keepachangelog auto-changelog --breaking-pattern 'BREAKING CHANGE:' && git add CHANGELOG.md",
2122
"watch": "run-p watch:*",
2223
"watch:compile": "npm run compile -- --watch",

0 commit comments

Comments
 (0)