ci(release): use npm@9 for semantic release #2
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: Validate | |
on: | |
push: | |
branches: [main, dev] | |
env: | |
NPM_VERSION: 9 | |
SEMANTIC_RELEASE_VERSION: 21.0.1 | |
jobs: | |
release: | |
name: Semantic release | |
runs-on: ubuntu-latest | |
permissions: write-all | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
# Needs to fetch historical commits in order to compare with origin/main | |
fetch-depth: 0 | |
persist-credentials: false | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install and configure NPM for workspaces | |
# NPM@9 has support for workspaces, we need to make sure that we have that version. `actions/setup-node` installs 8.19. | |
# @link: https://github.com/semantic-release/npm/pull/512 | |
run: | | |
npm install -g npm@${{ env.NPM_VERSION }} | |
npm config set workspaces=true workspaces-update=false --global | |
- name: Install dependencies | |
run: npm clean-install | |
- name: Semantic release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN || secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
NODE_ENV: production | |
HUSKY: 0 | |
run: | | |
npx --package @semantic-release/exec --package @semantic-release/git --package @semantic-release/changelog --package semantic-release-slack-bot --package semantic-release@${{ env.SEMANTIC_RELEASE_VERSION }} --package @qiwi/multi-semantic-release multi-semantic-release |