chore(deps): update dependency lint-staged to v15.3.0 (#865) #764
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: Release | |
on: | |
push: | |
branches: | |
- main | |
- next | |
- alpha | |
- beta | |
# N.x (maintenance release branches) | |
- '[0-9]+.x' | |
concurrency: | |
group: publish-${{ github.ref }} | |
env: | |
NODE_VERSION: 20.x | |
jobs: | |
publish: | |
name: publish | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Use Node.js ${{ env.NODE_VERSION }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: yarn | |
- name: Configure package manager | |
run: yarn config set npmAuthToken ${{ secrets.NPM_READ_TOKEN }} | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Lint | |
run: yarn lint | |
- name: Check types | |
run: yarn types | |
- name: Test | |
run: yarn test --coverage --silent | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload coverage to Coveralls | |
uses: coverallsapp/github-action@v2.3.4 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build | |
run: yarn build | |
- name: Cleanup .yarnrc.yml changes before publish | |
run: | | |
git restore .yarnrc.yml | |
- name: Semantic Release | |
uses: cycjimmy/semantic-release-action@v2 | |
id: semantic | |
with: | |
# TMP: We're fixing @semantic-release/github version because 8.0.9 is causing an unexpected issue: https://github.com/semantic-release/github/issues/642 | |
extra_plugins: | | |
@semantic-release/github@8.0.8 | |
semantic_version: ^18 | |
branches: | | |
[ | |
'+([0-9])?(.{+([0-9]),x}).x', | |
'main', | |
'next', | |
'next-major', | |
{name: 'beta', prerelease: true}, | |
{name: 'alpha', prerelease: true} | |
] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push updates to branch for major version | |
# If a new version is published, i.e. v1.2.3 then this step will update | |
# branch "v1" to this commit. | |
# https://github.com/reside-eng/workflow-status-notification-action/branches | |
# The dist folder (built) is included so that action can be used directly from Github | |
# ref (where exact versions can pull from npm) | |
if: steps.semantic.outputs.new_release_published == 'true' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# NOTE: Git user must be set in order for amend of commit to add dist folder | |
# --force is used because dist is within gitignore | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git add --force dist | |
git commit -C HEAD --amend | |
git push -f https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git HEAD:refs/heads/v${{steps.semantic.outputs.new_release_major_version}} | |
notification: | |
if: always() | |
name: notification | |
needs: [publish] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- uses: technote-space/workflow-conclusion-action@v3.0.3 | |
- uses: reside-eng/workflow-status-notification-action@v1 | |
with: | |
current-status: ${{ env.WORKFLOW_CONCLUSION }} | |
slack-webhook: ${{ secrets.SLACK_WEBHOOK_PLATFORM_PROD }} | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
is-release: true |