Skip to content

Commit ef2fc2e

Browse files
committed
PHPLIB-1462: update to drivers-github-tools v2
1 parent 6d62960 commit ef2fc2e

File tree

1 file changed

+22
-13
lines changed

1 file changed

+22
-13
lines changed

.github/workflows/release.yml

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ on:
1414
type: "string"
1515

1616
env:
17-
# TODO: Use different token
18-
GH_TOKEN: ${{ secrets.MERGE_UP_TOKEN }}
19-
GIT_AUTHOR_NAME: "DBX PHP Release Bot"
20-
GIT_AUTHOR_EMAIL: "[email protected]"
2117
default-release-message: |
2218
The PHP team is happy to announce that version {0} of the MongoDB PHP library is now available.
2319
@@ -41,13 +37,28 @@ env:
4137
4238
jobs:
4339
prepare-release:
40+
environment: release
4441
name: "Prepare release"
4542
runs-on: ubuntu-latest
43+
permissions:
44+
id-token: write
45+
contents: write
4646

4747
steps:
4848
- name: "Create release output"
4949
run: echo '🎬 Release process for version ${{ inputs.version }} started by @${{ github.triggering_actor }}' >> $GITHUB_STEP_SUMMARY
5050

51+
- name: "Create temporary app token"
52+
uses: actions/create-github-app-token@v1
53+
id: app-token
54+
with:
55+
app-id: ${{ vars.APP_ID }}
56+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
57+
58+
- name: "Store GitHub token in environment"
59+
run: echo "GH_TOKEN=${{ steps.app-token.outputs.token }}" >> "$GITHUB_ENV"
60+
shell: bash
61+
5162
- uses: actions/checkout@v4
5263
with:
5364
submodules: true
@@ -75,10 +86,12 @@ jobs:
7586
# Preliminary checks done - commence the release process
7687
#
7788

78-
- name: "Set git author information"
79-
run: |
80-
git config user.name "${GIT_AUTHOR_NAME}"
81-
git config user.email "${GIT_AUTHOR_EMAIL}"
89+
- name: "Set up drivers-github-tools"
90+
uses: mongodb-labs/drivers-github-tools/setup@v2
91+
with:
92+
aws_role_arn: ${{ secrets.AWS_ROLE_ARN }}
93+
aws_region_name: ${{ vars.AWS_REGION_NAME }}
94+
aws_secret_id: ${{ secrets.AWS_SECRET_ID }}
8295

8396
# Create a draft release with release message filled in
8497
- name: "Prepare release message"
@@ -92,13 +105,9 @@ jobs:
92105

93106
# This step creates the signed release tag
94107
- name: "Create release tag"
95-
uses: mongodb-labs/drivers-github-tools/garasign/git-sign@v1
108+
uses: mongodb-labs/drivers-github-tools/git-sign@v2
96109
with:
97110
command: "git tag -m 'Release ${{ inputs.version }}' -s --local-user=${{ vars.GPG_KEY_ID }} ${{ inputs.version }}"
98-
garasign_username: ${{ secrets.GRS_CONFIG_USER1_USERNAME }}
99-
garasign_password: ${{ secrets.GRS_CONFIG_USER1_PASSWORD }}
100-
artifactory_username: ${{ secrets.ARTIFACTORY_USER }}
101-
artifactory_password: ${{ secrets.ARTIFACTORY_PASSWORD }}
102111

103112
# TODO: Manually merge using ours strategy. This avoids merge-up pull requests being created
104113
# Process is:

0 commit comments

Comments
 (0)