22
22
release :
23
23
runs-on : ubuntu-latest
24
24
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
+
25
44
- name : Checkout code
26
45
uses : actions/checkout@v4
46
+ with :
47
+ token : ${{ steps.app-token.outputs.token }}
27
48
28
49
- name : Set up Java 8
29
50
uses : actions/setup-java@v4
59
80
sed -i "s/pyroscope_version=.*/pyroscope_version=$new_version/" gradle.properties
60
81
echo "version=$new_version" >> $GITHUB_OUTPUT
61
82
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
-
72
83
- name : Prepare GPG Keyring
73
84
id : prepare_gpg_keyring
74
85
run : |
@@ -82,20 +93,26 @@ jobs:
82
93
export NEXUS_GPG_SECRING_FILE=${{ steps.prepare_gpg_keyring.outputs.keyring_path }}
83
94
make publish
84
95
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"
86
99
env :
87
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
100
+ GITHUB_TOKEN : ${{ steps.app-token.outputs.token }}
101
+
102
+ - name : Commit Version Bump
88
103
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'
91
106
git add gradle.properties
92
107
git commit -m "version ${{ steps.bump_version.outputs.version }}"
93
108
git tag "v${{ steps.bump_version.outputs.version }}"
94
109
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 }}
95
112
96
113
- name : Create GitHub Release
97
114
env :
98
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
115
+ GITHUB_TOKEN : ${{ steps.app-token.outputs.token }}
99
116
run : |
100
117
gh release create "v${{ steps.bump_version.outputs.version }}" \
101
118
agent/build/libs/pyroscope.jar \
0 commit comments