Skip to content

Commit

Permalink
ci: implement automated release
Browse files Browse the repository at this point in the history
  • Loading branch information
barmac committed Oct 9, 2023
1 parent c6f53fb commit 9d7d845
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 8 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/POST_RELEASE.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: POST_RELEASE
on:
push:
tags:
- 'v[0-9]+.*'
- workflow_call
- workflow_dispatch

jobs:
post-release:

Expand Down Expand Up @@ -64,8 +64,3 @@ jobs:
BPMN_IO_EMAIL: ${{ secrets.BPMN_IO_EMAIL }}
BPMN_IO_USERNAME: ${{ secrets.BPMN_IO_USERNAME }}
run: tasks/stages/update-website
update-translations:
needs: post-release
secrets: inherit
if: ${{ needs.post-release.outputs.STABLE_RELEASE == 'true' }}
uses: ./.github/workflows/UPDATE_TRANSLATIONS.yml
57 changes: 57 additions & 0 deletions .github/workflows/RELEASE.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
on:
push:
branches:
- develop
name: release
jobs:
release-please:
outputs:
release_created: ${{ steps.release.outputs.release_created }}
permissions:
contents: write # to create release commit (google-github-actions/release-please-action)
pull-requests: write # to create release PR (google-github-actions/release-please-action)

runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node
default-branch: master

publish:
needs: release-please
if: ${{ needs.release-please.outputs.release_created }}

runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 20
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

post-release:
needs:
- release-please
- publish
if: ${{ needs.release-please.outputs.release_created }}
secrets: inherit
uses: ./.github/workflows/POST_RELEASE.yml

update-translations:
needs:
- release-please
- post-release
if: ${{ needs.release-please.outputs.release_created }} && ${{ needs.post-release.outputs.STABLE_RELEASE == 'true' }}
secrets: inherit
uses: ./.github/workflows/UPDATE_TRANSLATIONS.yml

0 comments on commit 9d7d845

Please sign in to comment.