Skip to content

πŸŒ’ Remix Nightly Release #314

πŸŒ’ Remix Nightly Release

πŸŒ’ Remix Nightly Release #314

Workflow file for this run

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 }}