File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,9 @@ name: generic-go-versionbuild
22
33on :
44 workflow_call :
5+ secrets :
6+ GPG_PRIVATE_KEY :
7+ required : true
58 inputs :
69 service :
710 required : true
@@ -165,12 +168,22 @@ jobs:
165168 merge-multiple : true
166169
167170 - name : package with nfpm
171+ env :
172+ GPG_PRIVATE_KEY : ${{ secrets.GPG_PRIVATE_KEY }}
173+ GPG_KEY_ID : mail@binarycodes.io
168174 run : |
169175 mkdir -p dist
170176 nfpm pkg --packager archlinux --config nfpm.yaml --target dist/
171177 nfpm pkg --packager deb --config nfpm.yaml --target dist/
178+
172179 # sign the package for arch linux
173- gpg --batch --yes --detach-sign dist/*.pkg.tar.zst
180+ test -n "$GPG_PRIVATE_KEY" || { echo "GPG_PRIVATE_KEY is empty"; exit 1; }
181+ printf '%s' "$GPG_PRIVATE_KEY_B64" | base64 -d | gpg --batch --import
182+ gpg --batch --list-secret-keys --keyid-format LONG
183+
184+ FPR="$(gpg --batch --list-secret-keys --with-colons | awk -F: '$1=="fpr"{print $10; exit}')"
185+
186+ gpg --batch --yes --local-user "$FPR" --detach-sign dist/*.pkg.tar.zst
174187
175188 - name : upload build artifact
176189 uses : actions/upload-artifact@v4
Original file line number Diff line number Diff line change 2424 with :
2525 service : go-ssh-keysign
2626 artifactVersion : ${{ needs.set-version.outputs.short_sha }}
27+ secrets :
28+ GPG_PRIVATE_KEY : ${{ secrets.GPG_PRIVATE_KEY }}
You can’t perform that action at this time.
0 commit comments