π Remix Nightly Release #314
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: π Remix Nightly Release | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 8 * * *" | |
pull_request: | |
types: [closed] | |
branches: | |
- main | |
paths: | |
- "package.json" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: | |
contents: write | |
pull-requests: write | |
env: | |
CI: true | |
jobs: | |
bump: | |
name: π¦ Bump Remix to latest nightly | |
if: github.repository == 'mcansh/mcan.sh' | |
runs-on: ubuntu-latest | |
steps: | |
- name: β¬οΈ Checkout repo | |
uses: actions/checkout@v4 | |
- name: β Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: π₯ Install dependencies | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
run_install: | | |
- recursive: true | |
args: [--frozen-lockfile, --strict-peer-dependencies] | |
- name: π¦ Bump Remix to latest nightly | |
id: bump | |
run: | | |
# reset the branch back to main | |
git reset --hard origin/main | |
# get the installed version of @remix-run/react | |
PREV_VERSION=$(npm ls --depth=0 @remix-run/react --json | jq -r '.dependencies["@remix-run/react"].version') | |
# if prev_version is not a nightly or experimental release, we'll need to scope it to the `remix@` tag prefix | |
if [[ $PREV_VERSION != *"nightly"* && $PREV_VERSION != *"experimental"* ]]; then | |
PREV_VERSION="remix@$PREV_VERSION" | |
else | |
# otherwise, we'll need to prefix it with `v` | |
PREV_VERSION="v$PREV_VERSION" | |
fi | |
# get the latest nightly version of @remix-run/react | |
VERSION=v$(npm info @remix-run/react dist-tags.nightly) | |
# upgrade @remix-run/* to the latest nightly | |
npx --yes upgrade-remix@latest $VERSION | |
# format the lockfile | |
npm run format | |
# check if there are any changes | |
if [ "$(git status --porcelain)" ]; then | |
echo "version=$VERSION" >> $GITHUB_OUTPUT | |
echo "prev_version=$PREV_VERSION" >> $GITHUB_OUTPUT | |
fi | |
- name: π€ Push changes | |
uses: gr2m/create-or-update-pull-request-action@v1 | |
if: steps.bump.outputs.version != '' && steps.bump.outputs.prev_version != '' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
title: "chore(deps): bump `@remix-run/*` to ${{ steps.bump.outputs.version }}" | |
commit-message: "chore(deps): bump `@remix-run/*` to ${{ steps.bump.outputs.version }}" | |
update-pull-request-title-and-body: true | |
branch: actions/remix-nightly | |
author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>" | |
body: | | |
This PR bumps \`@remix-run/*\` to the latest nightly release. For a list of changes, see the list of [changes][changes]. | |
[changes]: https://github.com/remix-run/remix/compare/${{ steps.bump.outputs.prev_version }}...${{ steps.bump.outputs.version }} |