Merge pull request #283 from philips-software/node18 #589
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
name: 'CI' | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # ratchet:actions/checkout@v3 | |
- uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # ratchet:actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install dependencies | |
run: yarn install | |
- name: Check format and lint | |
run: yarn run format-check && yarn lint | |
- name: Build and package | |
run: yarn build | |
- name: Update dist in the repository | |
if: github.event_name != 'pull_request' | |
uses: stefanzweifel/git-auto-commit-action@3ea6ae190baf489ba007f7c92608f33ce20ef04a # ratchet:stefanzweifel/git-auto-commit-action@v4.16.0 | |
with: | |
commit_message: 'chore(ci): Updating dist' | |
file_pattern: dist/* | |
release: | |
if: github.event_name != 'pull_request' | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # ratchet:actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # ratchet:actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- uses: ./ | |
id: app | |
with: | |
app_id: ${{ secrets.FOREST_RELEASER_APP_ID }} | |
app_base64_private_key: ${{ secrets.FOREST_RELEASER_APP_PRIVATE_KEY_BASE64 }} | |
auth_type: installation | |
org: philips-software | |
- name: Extract branch name | |
run: echo ::set-output name=short_ref::${GITHUB_REF#refs/*/} | |
id: branch | |
- name: Dry run release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: yarn && yarn run release -d -b ${{ steps.branch.outputs.short_ref }} | |
- name: Release | |
if: github.event_name != 'pull_request' && contains('refs/heads/main', github.ref) | |
env: | |
GITHUB_TOKEN: ${{ steps.app.outputs.token }} | |
run: yarn && yarn run release |