Skip to content

Exit prerelease mode #271

Exit prerelease mode

Exit prerelease mode #271

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@v3
with:
fetch-depth: 0
- name: βŽ” Setup node
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: "yarn"
- name: πŸ“₯ Install deps
run: yarn --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: yarn run version
commit: "chore: Update version for release"
title: "chore: Update version for release"
publish: yarn 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@v3
- name: βŽ” Setup node
uses: actions/setup-node@v3
with:
node-version: 16
cache: "npm"
- 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