Skip to content

Commit 798a5ba

Browse files
authored
PHPORM-190: Update drivers-github-tools to v2 (#2998)
1 parent 2daa0ea commit 798a5ba

File tree

1 file changed

+23
-16
lines changed

1 file changed

+23
-16
lines changed

.github/workflows/release.yml

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,30 @@ on:
99
required: true
1010
type: "string"
1111

12-
env:
13-
# TODO: Use different token
14-
GH_TOKEN: ${{ secrets.MERGE_UP_TOKEN }}
15-
GIT_AUTHOR_NAME: "DBX PHP Release Bot"
16-
GIT_AUTHOR_EMAIL: "[email protected]"
17-
1812
jobs:
1913
prepare-release:
14+
environment: release
2015
name: "Prepare release"
2116
runs-on: ubuntu-latest
17+
permissions:
18+
id-token: write
19+
contents: write
2220

2321
steps:
2422
- name: "Create release output"
2523
run: echo '🎬 Release process for version ${{ inputs.version }} started by @${{ github.triggering_actor }}' >> $GITHUB_STEP_SUMMARY
2624

25+
- name: "Create temporary app token"
26+
uses: actions/create-github-app-token@v1
27+
id: app-token
28+
with:
29+
app-id: ${{ vars.APP_ID }}
30+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
31+
32+
- name: "Store GitHub token in environment"
33+
run: echo "GH_TOKEN=${{ steps.app-token.outputs.token }}" >> "$GITHUB_ENV"
34+
shell: bash
35+
2736
- uses: actions/checkout@v4
2837
with:
2938
submodules: true
@@ -51,24 +60,22 @@ jobs:
5160
# Preliminary checks done - commence the release process
5261
#
5362

54-
- name: "Set git author information"
55-
run: |
56-
git config user.name "${GIT_AUTHOR_NAME}"
57-
git config user.email "${GIT_AUTHOR_EMAIL}"
63+
- name: "Set up drivers-github-tools"
64+
uses: mongodb-labs/drivers-github-tools/setup@v2
65+
with:
66+
aws_role_arn: ${{ secrets.AWS_ROLE_ARN }}
67+
aws_region_name: ${{ vars.AWS_REGION_NAME }}
68+
aws_secret_id: ${{ secrets.AWS_SECRET_ID }}
5869

5970
# Create draft release with release notes
6071
- name: "Create draft release"
6172
run: echo "RELEASE_URL=$(gh release create ${{ inputs.version }} --target ${{ github.ref_name }} --title "${{ inputs.version }}" --generate-notes --draft)" >> "$GITHUB_ENV"
6273

6374
# This step creates the signed release tag
6475
- name: "Create release tag"
65-
uses: mongodb-labs/drivers-github-tools/garasign/git-sign@v1
76+
uses: mongodb-labs/drivers-github-tools/git-sign@v2
6677
with:
67-
command: "git tag -m 'Release ${{ inputs.version }}' -s --local-user=${{ vars.GPG_KEY_ID }} ${{ inputs.version }}"
68-
garasign_username: ${{ secrets.GRS_CONFIG_USER1_USERNAME }}
69-
garasign_password: ${{ secrets.GRS_CONFIG_USER1_PASSWORD }}
70-
artifactory_username: ${{ secrets.ARTIFACTORY_USER }}
71-
artifactory_password: ${{ secrets.ARTIFACTORY_PASSWORD }}
78+
command: "git tag -m 'Release ${{ inputs.version }}' -s --local-user=${{ env.GPG_KEY_ID }} ${{ inputs.version }}"
7279

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

0 commit comments

Comments
 (0)