From 3cb831d3452bce54c4a782e53428029a40c5055d Mon Sep 17 00:00:00 2001 From: Claas Augner Date: Thu, 21 May 2026 23:25:08 +0200 Subject: [PATCH 1/3] feat: maintain "next" GitHub release with latest main --- .github/workflows/prerelease.yml | 80 ++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 .github/workflows/prerelease.yml diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml new file mode 100644 index 00000000000000..f1b1575de7d461 --- /dev/null +++ b/.github/workflows/prerelease.yml @@ -0,0 +1,80 @@ +name: Publish @mdn/browser-compat-data@next + +on: + push: + branches: + - main + - prerelease + +permissions: + contents: write + +env: + package: "@mdn/browser-compat-data" + tag: "next" + +jobs: + publish: + if: github.repository == 'mdn/browser-compat-data' + name: Publish next pre-release + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + ref: main + + - name: Setup Node + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + with: + node-version-file: .nvmrc + cache: npm + package-manager-cache: true + + - name: Install + run: npm ci + + - name: Build + run: npm run build + + - name: Get short hash + id: hash + run: echo "SHORT_HASH=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT" + + - name: Ensure `next` pre-release exists + env: + GH_TOKEN: ${{ github.token }} + run: | + if ! gh release view "$tag" >/dev/null 2>&1; then + gh release create "$tag" \ + --title "$package@$tag" \ + --notes "Bootstrapping next pre-release." \ + --prerelease + fi + + - name: Draft existing release while we move the tag + env: + GH_TOKEN: ${{ github.token }} + run: gh release edit --draft "$tag" + + - name: Move the `next` tag + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git tag --force "$tag" + git push --force origin "$tag" + + - name: Publish the pre-release + env: + GH_TOKEN: ${{ github.token }} + SHORT_HASH: ${{ steps.hash.outputs.SHORT_HASH }} + NOTES: "This is a continuously-updated prerelease generated from `main` (currently at ${{ steps.hash.outputs.SHORT_HASH }})." + run: | + gh release edit \ + --verify-tag \ + --title "$package@$tag" \ + --notes "$NOTES" \ + --prerelease \ + --draft=false \ + "$tag" + gh release upload --clobber "$tag" build/data.json From cbd5527adfc2f9f30ad549e9a01cc5cb2ef612ff Mon Sep 17 00:00:00 2001 From: Claas Augner <495429+caugner@users.noreply.github.com> Date: Fri, 22 May 2026 17:40:09 +0200 Subject: [PATCH 2/3] ci(prerelease): use concurrency group --- .github/workflows/prerelease.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index f1b1575de7d461..ad1a8c68e1a017 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -6,6 +6,8 @@ on: - main - prerelease +concurrency: + group: ${{ github.workflow }} permissions: contents: write From 571ca709206a2e2b6107d3cf6b5669139ac9e572 Mon Sep 17 00:00:00 2001 From: Claas Augner <495429+caugner@users.noreply.github.com> Date: Fri, 22 May 2026 17:42:36 +0200 Subject: [PATCH 3/3] ci(prerelease): remove PR branch trigger Co-authored-by: Leo McArdle --- .github/workflows/prerelease.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index ad1a8c68e1a017..ff35c872d23126 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -4,7 +4,6 @@ on: push: branches: - main - - prerelease concurrency: group: ${{ github.workflow }}