From bf6b26ba1092e6189d44dd1ad146e0deb5edf348 Mon Sep 17 00:00:00 2001 From: Matt Brophy Date: Tue, 19 Mar 2024 10:01:24 -0400 Subject: [PATCH] Move experimental releases to a manually triggered workflow --- .github/workflows/nightly.yml | 5 +- .../release-experimental-dispatch.yml | 59 ++++++++++++++++ .github/workflows/release-experimental.yml | 67 ------------------- 3 files changed, 60 insertions(+), 71 deletions(-) create mode 100644 .github/workflows/release-experimental-dispatch.yml delete mode 100644 .github/workflows/release-experimental.yml diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index a07dcca2e2e..1744b3cf68d 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -49,10 +49,7 @@ jobs: - name: ๐Ÿ•ต๏ธ Check for changes id: version run: | - # get latest commit sha - SHA=$(git rev-parse HEAD) - # get first 7 characters of sha - SHORT_SHA=${SHA::7} + SHORT_SHA=$(git rev-parse --short HEAD) # get latest nightly tag LATEST_NIGHTLY_TAG=$(git tag -l v0.0.0-nightly-\* --sort=-creatordate | head -n 1) diff --git a/.github/workflows/release-experimental-dispatch.yml b/.github/workflows/release-experimental-dispatch.yml new file mode 100644 index 00000000000..5e636c792af --- /dev/null +++ b/.github/workflows/release-experimental-dispatch.yml @@ -0,0 +1,59 @@ +name: ๐Ÿงช Experimental Release + +on: + workflow_dispatch: + inputs: + branch: + required: true + +concurrency: ${{ github.workflow }}-${{ github.ref }} + +env: + CI: true + +jobs: + experimental: + name: ๐Ÿงช Experimental Release + if: github.repository == 'remix-run/remix' + runs-on: ubuntu-latest + steps: + - name: โฌ‡๏ธ Checkout repo + uses: actions/checkout@v4 + with: + ref: ${{ github.event.inputs.branch }} + # checkout using a custom token so that we can push later on + token: ${{ secrets.NIGHTLY_PAT }} + 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: โคด๏ธ Update version + run: | + git config --local user.email "hello@remix.run" + git config --local user.name "Remix Run Bot" + SHORT_SHA=$(git rev-parse --short HEAD) + NEXT_VERSION=0.0.0-experimental-${SHORT_SHA} + git checkout -b experimental/${NEXT_VERSION} + pnpm run version ${NEXT_VERSION} --skip-prompt + git push origin --tags + + - name: ๐Ÿ— Build + run: pnpm build + + - name: ๐Ÿ” Setup npm auth + run: | + echo "registry=https://registry.npmjs.org" >> ~/.npmrc + echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc + + - name: ๐Ÿš€ Publish + run: npm run publish diff --git a/.github/workflows/release-experimental.yml b/.github/workflows/release-experimental.yml deleted file mode 100644 index c79c36583dc..00000000000 --- a/.github/workflows/release-experimental.yml +++ /dev/null @@ -1,67 +0,0 @@ -# Experimental releases are handled a bit differently than standard releases. -# Experimental releases can be branched from anywhere as they are not intended -# for general use, and all packages will be versioned and published with the -# same hash for testing. -# -# This workflow will run when a GitHub release is created from experimental -# version tag. Unlike standard releases created via Changesets, only one tag -# should be created for all packages. -# -# To create a release: -# - Create a new branch for the release: git checkout -b `release-experimental` -# - IMPORTANT: You should always create a new branch so that the version -# changes don't accidentally get merged into `dev` or `main`. The branch -# name must follow the convention of `release-experimental` or -# `release-experimental-[feature]`. -# - Make whatever changes you need and commit them: -# - `git add . && git commit "experimental changes!"` -# - Update version numbers and create a release tag: -# - `yarn run version:experimental` -# - Push to GitHub: -# - `git push origin --follow-tags` -# - Create a new release for the tag on GitHub to trigger the CI workflow that -# will publish the release to npm - -name: ๐Ÿš€ Release (experimental) -on: - push: - tags: - - "v0.0.0-experimental*" - -concurrency: ${{ github.workflow }}-${{ github.ref }} - -env: - CI: true - -jobs: - release: - name: ๐Ÿง‘โ€๐Ÿ”ฌ Experimental Release - if: | - github.repository == 'remix-run/remix' && - contains(github.ref, 'experimental') - runs-on: ubuntu-latest - steps: - - name: โฌ‡๏ธ Checkout repo - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: โŽ” Setup node - uses: actions/setup-node@v4 - with: - node-version-file: ".nvmrc" - cache: "yarn" - - - name: ๐Ÿ“ฅ Install deps - run: yarn --frozen-lockfile - - - name: ๐Ÿ— Build - run: yarn build - - - name: ๐Ÿ” Setup npm auth - run: | - echo "registry=https://registry.npmjs.org" >> ~/.npmrc - echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc - - - name: ๐Ÿš€ Publish - run: npm run publish