Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Extract release milestone management into a reusable workflow (#74219)

Nemanja Glumac3953dd3bf652
diff --git a/.github/workflows/build-for-release.yml b/.github/workflows/build-for-release.yml
index 663c4980298..257054f8618 100644
--- a/.github/workflows/build-for-release.yml
+++ b/.github/workflows/build-for-release.yml
@@ -187,43 +187,13 @@ jobs:
# so any PRs that merge while the build is in flight are tagged with the next
# milestone (not the one about to be released). Gated on the preflight checks
# so a bad version/commit input doesn't rotate the milestone spuriously.
- runs-on: ${{ vars.DEFAULT_RUNNER_KEY }}
needs: [check-version, check-commit]
- timeout-minutes: 15
- steps:
- - uses: actions/checkout@v4
- with:
- sparse-checkout: |
- release
- .github
- - name: Prepare release scripts
- uses: ./.github/actions/prepare-release-scripts
- - name: Update milestones
- uses: actions/github-script@v7
- with:
- script: | # js
- const { closeMilestone, openNextMilestones, isPreReleaseVersion } = require('${{ github.workspace }}/release/dist/index.cjs');
-
- const version = '${{ inputs.version }}';
-
- if (isPreReleaseVersion(version)) {
- console.log("This is a prerelease version, skipping milestone management");
- return;
- }
-
- await closeMilestone({
- github,
- owner: context.repo.owner,
- repo: context.repo.repo,
- version,
- }).catch(console.error);
-
- await openNextMilestones({
- github,
- owner: context.repo.owner,
- repo: context.repo.repo,
- version,
- }).catch(console.error);
+ permissions:
+ contents: read
+ issues: write
+ uses: ./.github/workflows/release-milestone-manage.yml
+ with:
+ version: ${{ inputs.version }}
build-uberjar-for-release:
needs: [check-version, check-commit, get-build-requirements]
diff --git a/.github/workflows/release-milestone-manage.yml b/.github/workflows/release-milestone-manage.yml
new file mode 100644
index 00000000000..33f7d7490ce
--- /dev/null
+++ b/.github/workflows/release-milestone-manage.yml
@@ -0,0 +1,63 @@
+name: Release Milestone Management
+run-name: Manage milestones for ${{ inputs.version }}
+
+# Closes the milestone we're about to ship and opens the next one.
+# Reusable so the release workflows can run it before building/tagging, and
+# exposed via workflow_dispatch so it can be run by hand if a release misses it.
+
+on:
+ workflow_call:
+ inputs:
+ version:
+ description: 'Metabase version (e.g. v0.46.3)'
+ type: string
+ required: true
+ workflow_dispatch:
+ inputs:
+ version:
+ description: 'Metabase version (e.g. v0.46.3)'
+ type: string
+ required: true
+
+permissions:
+ contents: read
+ issues: write
+
+jobs:
+ manage-milestones:
+ runs-on: ${{ vars.DEFAULT_RUNNER_KEY }}
+ timeout-minutes: 15
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ sparse-checkout: |
+ release
+ .github
+ - name: Prepare release scripts
+ uses: ./.github/actions/prepare-release-scripts
+ - name: Update milestones
+ uses: actions/github-script@v7
+ with:
+ script: | # js
+ const { closeMilestone, openNextMilestones, isPreReleaseVersion } = require('${{ github.workspace }}/release/dist/index.cjs');
+
+ const version = '${{ inputs.version }}';
+
+ if (isPreReleaseVersion(version)) {
+ console.log("This is a prerelease version, skipping milestone management");
+ return;
+ }
+
+ await closeMilestone({
+ github,
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ version,
+ }).catch(console.error);
+
+ await openNextMilestones({
+ github,
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ version,
+ }).catch(console.error);
diff --git a/.github/workflows/tag-for-release.yml b/.github/workflows/tag-for-release.yml
index b295c80a7ea..335eaf1b775 100644
--- a/.github/workflows/tag-for-release.yml
+++ b/.github/workflows/tag-for-release.yml
@@ -139,6 +139,19 @@ jobs:
|| (echo "Commit not found in correct release branch" && exit 1)
git checkout -
+ manage-milestones:
+ # Close the milestone we're about to ship and open the next one BEFORE tagging,
+ # so any PRs that merge while the release is in flight are tagged with the next
+ # milestone (not the one about to be released). Gated on the preflight checks
+ # so a bad version/commit input doesn't rotate the milestone spuriously.
+ needs: [check-version, check-commit]
+ permissions:
+ contents: read
+ issues: write
+ uses: ./.github/workflows/release-milestone-manage.yml
+ with:
+ version: ${{ inputs.version }}
+
tag-uberjar-for-release:
needs: [check-version, check-commit]
runs-on: ${{ vars.DEFAULT_RUNNER_KEY }}