Skip to content

Commit be3f49c

Browse files
committed
Use pyroscope-development-app in release workflow
1 parent 857c609 commit be3f49c

File tree

1 file changed

+32
-15
lines changed

1 file changed

+32
-15
lines changed

.github/workflows/release.yml

+32-15
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,29 @@ jobs:
2222
release:
2323
runs-on: ubuntu-latest
2424
steps:
25+
- name: Get secrets
26+
uses: grafana/shared-workflows/actions/get-vault-secrets@main
27+
with:
28+
repo_secrets: |
29+
NEXUS_USERNAME=publishing:nexus_username
30+
NEXUS_PASSWORD=publishing:nexus_password
31+
NEXUS_GPG_KEY_ID=publishing:nexus_gpg_key_id
32+
NEXUS_GPG_PASSWORD=publishing:nexus_gpg_password
33+
NEXUS_GPG_SECRING_FILE_BASE64=publishing:nexus_gpg_secring_file
34+
GITHUB_APP_ID=pyroscope-development-app:app-id
35+
GITHUB_APP_PRIVATE_KEY=pyroscope-development-app:app-private-key
36+
37+
- name: Generate GitHub token
38+
uses: actions/create-github-app-token@v1
39+
id: app-token
40+
with:
41+
app-id: ${{ env.GITHUB_APP_ID }}
42+
private-key: ${{ env.GITHUB_APP_PRIVATE_KEY }}
43+
2544
- name: Checkout code
2645
uses: actions/checkout@v4
46+
with:
47+
token: ${{ steps.app-token.outputs.token }}
2748

2849
- name: Set up Java 8
2950
uses: actions/setup-java@v4
@@ -59,16 +80,6 @@ jobs:
5980
sed -i "s/pyroscope_version=.*/pyroscope_version=$new_version/" gradle.properties
6081
echo "version=$new_version" >> $GITHUB_OUTPUT
6182
62-
- name: Get secrets
63-
uses: grafana/shared-workflows/actions/get-vault-secrets@main
64-
with:
65-
repo_secrets: |
66-
NEXUS_USERNAME=publishing:nexus_username
67-
NEXUS_PASSWORD=publishing:nexus_password
68-
NEXUS_GPG_KEY_ID=publishing:nexus_gpg_key_id
69-
NEXUS_GPG_PASSWORD=publishing:nexus_gpg_password
70-
NEXUS_GPG_SECRING_FILE_BASE64=publishing:nexus_gpg_secring_file
71-
7283
- name: Prepare GPG Keyring
7384
id: prepare_gpg_keyring
7485
run: |
@@ -82,20 +93,26 @@ jobs:
8293
export NEXUS_GPG_SECRING_FILE=${{ steps.prepare_gpg_keyring.outputs.keyring_path }}
8394
make publish
8495
85-
- name: Commit and Push Changes
96+
- name: Get GitHub App User ID
97+
id: get-user-id
98+
run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
8699
env:
87-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
100+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
101+
102+
- name: Commit Version Bump
88103
run: |
89-
git config user.name "github-actions[bot]"
90-
git config user.email "github-actions[bot]@users.noreply.github.com"
104+
git config --global user.name '${{ steps.app-token.outputs.app-slug }}[bot]'
105+
git config --global user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com'
91106
git add gradle.properties
92107
git commit -m "version ${{ steps.bump_version.outputs.version }}"
93108
git tag "v${{ steps.bump_version.outputs.version }}"
94109
git push --atomic origin "refs/heads/main" "refs/tags/v${{ steps.bump_version.outputs.version }}"
110+
env:
111+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
95112

96113
- name: Create GitHub Release
97114
env:
98-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
115+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
99116
run: |
100117
gh release create "v${{ steps.bump_version.outputs.version }}" \
101118
agent/build/libs/pyroscope.jar \

0 commit comments

Comments
 (0)