v17.0.0-rc.0 #17
Workflow file for this run
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: NPM Publish | |
on: | |
release: | |
types: [created] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-yarn-dependencies | |
with: | |
path: .yarn/cache | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: install | |
run: yarn --immutable | |
- name: build | |
run: yarn build | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: dist/ | |
publish-npm: | |
needs: build | |
environment: production | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
registry-url: https://registry.npmjs.org/ | |
- name: Set env | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV | |
- uses: actions/download-artifact@v4 | |
with: | |
name: dist | |
path: ./dist | |
- name: Set new version | |
run: npm version --no-git-tag-version ${{ env.RELEASE_VERSION }} | |
- run: npm publish --provenance | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} |