Update actions #112
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: | |
- master | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
environment: release | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v4 # v4 | |
with: | |
# Needed to ensure Github actions are run even when the pull request is rebased. | |
# https://github.com/changesets/action/issues/187#issuecomment-1228413850 | |
token: ${{ secrets.GH_PAT_PULL_REQUEST }} | |
- uses: ./.github/workflows/setup | |
- name: Update npm config | |
run: npm config set '//registry.npmjs.org/:_authToken' '${NPM_TOKEN}' | |
# Create a pull request with all of the package versions and | |
# changelogs updated and when there are new changesets on master, | |
# the PR will be updated. When the PR is merged the packages are | |
# published to NPM automatically. | |
- name: Create Release Pull Request or Publish to npm | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
version: pnpm run version | |
publish: pnpm publish -r | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_PAT_PULL_REQUEST }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |