From 99e9a6e7274218ade8edeee7137c6a1cdfc494ec Mon Sep 17 00:00:00 2001 From: Justin Ridgewell Date: Tue, 7 Feb 2023 18:36:25 -0500 Subject: [PATCH] Automate nightly Turbopack release tagging (#3594) This adds a new workflow which automatically releases nightly versions of turbopack. Coupled with https://github.com/vercel/next.js/pull/45506, we'll be able to fully automate our release process into Next.js. 1. The process kicks of with cron every midnight-ish PST. 2. We find the latest commit that passes CI 3. We bump the latest tag version (more on this in a bit) 4. We generate a new GH release with this version The automated tagging version will break with our current `turbopack-YYMMDD.XYZ` release process just a bit. The tag action that I'm using can't generate a date-like tag, it can only handle semver (with optional prefix). So I've set it up to generate `turbopack-MAJOR.MINOR.PATCH-nightly.XYZ` tags. The `turbopack-` here differentiates us from Turborepo, and the `nightly` tag denotes this a non-release software. I hope that I've configured this correctly to always bump patches, but I'm not 100% confident until it runs. Fixes WEB-502 --- .../workflows/turbopack-nightly-release.yml | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/turbopack-nightly-release.yml diff --git a/.github/workflows/turbopack-nightly-release.yml b/.github/workflows/turbopack-nightly-release.yml new file mode 100644 index 0000000000000..3debe621fe090 --- /dev/null +++ b/.github/workflows/turbopack-nightly-release.yml @@ -0,0 +1,42 @@ +name: Turobpack Nightly Release + +on: + schedule: + - cron: "15 8 * * *" # Run every day at 00:15 PST + workflow_dispatch: + +jobs: + turbopack_nightly: + name: Cut nightly Turbopack release + runs-on: ubuntu-latest + steps: + - name: Checkout latest commit that passes CI + uses: talentpair/last-green-commit-action@d95cfa8 + id: green_commit + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Tag nightly + id: tag_version + uses: mathieudutour/github-tag-action@v6.1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + commit_sha: ${{ steps.green_commit.outputs.result }} + tag_prefix: "turbopack-" + # Override the default conventional commit messages + # so that we always generate patch releases. + # This would be easier if we could filter Turbopack + # commits from Turborepo, but that'd require a custom + # action. + custom_release_rules: "" + # Ensure we generate prerelease versions, not stables. + release_branches: "" + pre_release_branches: "main" + append_to_pre_release_tag: "nightly" + + - name: Create GitHub release + uses: ncipollo/release-action@v1 + with: + tag: ${{ steps.tag_version.outputs.new_tag }} + name: Turbopack Release ${{ steps.tag_version.outputs.new_tag }} + omitBody: true