This repository has been archived by the owner on Jan 10, 2025. It is now read-only.
Merge pull request #255 from philips-software/dependabot/npm_and_yarn… #582
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@ac593985615ec2ede58e132d2e21d2b1cbd6127c # ratchet:actions/checkout@v3 | |
- uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # ratchet:actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- 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/[email protected] | |
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@ac593985615ec2ede58e132d2e21d2b1cbd6127c # ratchet:actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # ratchet:actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- 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 |