chore: Update version for release (#12344) #468
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: π¦ Changesets Release | |
on: | |
push: | |
branches: | |
- release | |
- "release-*" | |
- "!release-experimental" | |
- "!release-experimental-*" | |
- "!release-manual" | |
- "!release-manual-*" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
release: | |
name: π¦ Changesets Release | |
if: github.repository == 'remix-run/react-router' | |
runs-on: ubuntu-latest | |
outputs: | |
published_packages: ${{ steps.changesets.outputs.publishedPackages }} | |
published: ${{ steps.changesets.outputs.published }} | |
steps: | |
- name: β¬οΈ Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: π¦ Setup pnpm | |
uses: pnpm/action-setup@v4 | |
- name: β Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
cache: "pnpm" | |
- name: π₯ Install deps | |
run: pnpm install --frozen-lockfile | |
- name: π Setup npm auth | |
run: | | |
echo "registry=https://registry.npmjs.org" >> ~/.npmrc | |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc | |
# This action has two responsibilities. The first time the workflow runs | |
# (initial push to a `release-*` branch) it will create a new branch and | |
# then open a PR with the related changes for the new version. After the | |
# PR is merged, the workflow will run again and this action will build + | |
# publish to npm. | |
- name: π PR / Publish | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
version: pnpm run changeset:version | |
commit: "chore: Update version for release" | |
title: "chore: Update version for release" | |
publish: pnpm run release | |
createGithubReleases: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
find_package_version: | |
name: π¦ Find Package | |
needs: [release] | |
runs-on: ubuntu-latest | |
if: github.repository == 'remix-run/react-router' && needs.release.outputs.published == 'true' | |
outputs: | |
package_version: ${{ steps.find_package_version.outputs.package_version }} | |
steps: | |
- name: β¬οΈ Checkout repo | |
uses: actions/checkout@v4 | |
- name: π¦ Setup pnpm | |
uses: pnpm/action-setup@v4 | |
- name: β Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
cache: "pnpm" | |
- id: find_package_version | |
run: | | |
package_version=$(node ./scripts/find-release-from-changeset.js) | |
echo "package_version=${package_version}" >> $GITHUB_OUTPUT | |
env: | |
PACKAGE_VERSION_TO_FOLLOW: "react-router" | |
PUBLISHED_PACKAGES: ${{ needs.release.outputs.published_packages }} | |
comment: | |
name: π Comment on related issues and pull requests | |
if: github.repository == 'remix-run/react-router' && needs.find_package_version.outputs.package_version != '' | |
needs: [release, find_package_version] | |
uses: ./.github/workflows/release-comments.yml |