Skip to content

Commit f7a7f46

Browse files
committed
Run packaging manually from release workflow
1 parent de60ed2 commit f7a7f46

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

.github/workflows/package-release.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@ name: "Package Release"
22
run-name: "Package Release ${{ github.ref_name }}"
33

44
on:
5-
push:
6-
tags:
7-
- "*"
5+
workflow_call:
6+
inputs:
7+
ref:
8+
description: "The git reference to build"
9+
type: string
10+
required: true
811

912
jobs:
1013
build-pecl:
@@ -31,7 +34,7 @@ jobs:
3134
with:
3235
# Manually specify a ref. When actions/checkout is run for a tag without a ref, it looks up the underlying
3336
# commit and specifically fetches this to the refs/tags/<tag> ref, which denies us access to the tag message
34-
ref: ${{ github.ref }}
37+
ref: ${{ inputs.ref }}
3538
submodules: true
3639

3740
- name: "Set up drivers-github-tools"
@@ -111,6 +114,7 @@ jobs:
111114
- uses: actions/checkout@v4
112115
with:
113116
submodules: true
117+
ref: ${{ inputs.ref }}
114118

115119
- name: "Build Driver"
116120
id: build-driver
@@ -167,6 +171,8 @@ jobs:
167171
shell: bash
168172

169173
- uses: actions/checkout@v4
174+
with:
175+
ref: ${{ inputs.ref }}
170176

171177
- name: "Set up drivers-github-tools"
172178
uses: mongodb-labs/drivers-github-tools/setup@v2

.github/workflows/release.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,20 @@ jobs:
155155
- name: "Update release information"
156156
run: echo "RELEASE_URL=$(gh release edit ${{ env.PACKAGE_VERSION }} --title "${{ env.PACKAGE_VERSION }}" --notes-file release-message)" >> "$GITHUB_ENV"
157157

158-
# Pushing the release tag starts build processes that then produce artifacts for the release
159158
- name: "Push release tag"
160159
run: git push origin ${{ env.PACKAGE_VERSION }}
161160

162161
- name: "Set summary"
163162
run: |
164163
echo '🚀 Created tag and drafted release for version [${{ inputs.version }}](${{ env.RELEASE_URL }})' >> $GITHUB_STEP_SUMMARY
165164
echo '✍️ You may now update the release notes and publish the release when ready' >> $GITHUB_STEP_SUMMARY
165+
166+
package-release:
167+
needs: prepare-release
168+
name: "Create Release Packages"
169+
uses: ./.github/workflows/package-release.yml
170+
with:
171+
ref: refs/tags/${{ inputs.version }}
172+
secrets: inherit
173+
permissions:
174+
id-token: write

0 commit comments

Comments
 (0)