-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- adds release.yml to deploy from ci if tests pass on main and there is a change to the changelog - fix bug in build.yml where node version variable name was wrong. testing was not really done on multiple node versions! License: MIT Signed-off-by: Oli Evans <oli@protocol.ai>
- Loading branch information
Showing
2 changed files
with
39 additions
and
1 deletion.
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
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,38 @@ | ||
on: | ||
# run after the "build" workflow | ||
workflow_run: | ||
workflows: [build] | ||
branches: [main] | ||
types: | ||
- completed | ||
|
||
name: Release | ||
jobs: | ||
changelog: | ||
# only run if tests succeed. | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
outputs: | ||
release_created: ${{ steps.rp.outputs.release_created }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: google-github-actions/release-please-action@v3 | ||
id: rp | ||
with: | ||
release-type: node | ||
package-name: dagula | ||
changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"chore","section":"Other Changes","hidden":false}]' | ||
|
||
publish: | ||
# only publish if there is a change to the changelog | ||
needs: changelog | ||
if: ${{ needs.changelog.outputs.release_created }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: 'npm' | ||
- run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |