Skip to content

Enter prerelease mode #379

Enter prerelease mode

Enter prerelease mode #379

Workflow file for this run

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@v3.0.0
- 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 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@v3.0.0
- name: βŽ” Setup node
uses: actions/setup-node@v4
with:
node-version: 16
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