Open mStirner opened 2 years ago
Workflow should be: 1) Lint 2) Build 3) Test 4) HTTP API test 5) Release (docker/github)
name: Release Workflow
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '16'
- run: npm ci
- run: npm run release
- name: "Read package.json"
run: echo "PACKAGE_JSON=$(jq -c . < package.json)" >> $GITHUB_ENV
- uses: ncipollo/release-action@v1
with:
artifacts: "dist/*"
tag: "v${{ fromJson(env.PACKAGE_JSON).version }}"
generateReleaseNotes: true
skipIfReleaseExists: true
https://github.com/mStirner/playground-test-auto-release
Run action only if merge and not rejected/closed. For pushes/merges on dev the "pre-release" flag could be set and the exisiting version release could be updated: https://github.com/marketplace/actions/create-release
The autogenerated release notes are ugly. Wrong order (newest changes should be on top, not bottom). Use "external" other github action to generated release notes, like "scottbrenner/generate-changelog-action@master" ?
A quick test with github actions to release new version was semi successful. Release a build & created, but the are error with tagging & body content.
./github/workflows/release.yml
:actions/create-release@v1
is not maintained any more. When you use${{ github.ref }}
for thetag_name
field following error occurs:{"resource":"Release","code":"already_exists","field":"tag_name"}
Something to read:
How to handle "version bumping", tag creating, releasing process.