Skip to content

Commit 63530b7

Browse files
Updated ".github/workflows/workflow.yml"
1 parent 3581fc5 commit 63530b7

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

.github/workflows/workflow.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
| sed 's|refs/tags/||' \
2828
| tail -n1 > latest_tag.txt
2929
latest_tag=$(cat latest_tag.txt)
30-
echo "Latest upstream tag: $latest_tag"
30+
echo "latest_tag=$latest_tag" >> $GITHUB_OUTPUT
3131
3232
- name: Read last built upstream tag from repo (if exists)
3333
id: read_last_tag
@@ -236,15 +236,32 @@ jobs:
236236
- name: Install GitHub CLI
237237
run: sudo apt-get update && sudo apt-get install -y gh
238238

239-
- name: Create tag if not exists
239+
- name: Set up Git user
240+
run: |
241+
git config --global user.name "Steven Seifried"
242+
git config --global user.email "[email protected]"
243+
244+
- name: Import GPG key and configure git signing
245+
env:
246+
GPGKEY: ${{ secrets.GPGKEY }}
247+
run: |
248+
echo "$GPGKEY" | base64 --decode | gpg --batch --import
249+
KEYID=$(gpg --list-secret-keys --with-colons | grep '^sec' | cut -d: -f5 | head -n1)
250+
echo "Using GPG Key: $KEYID"
251+
git config --global user.signingkey "$KEYID"
252+
git config --global gpg.program gpg
253+
git config --global tag.gpgSign true
254+
export GPG_TTY=$(tty)
255+
256+
- name: Create signed tag if not exists
240257
run: |
241258
TAG="${{ needs.check-upstream-latest-tag.outputs.tag_name }}"
242259
if git rev-parse "$TAG" >/dev/null 2>&1; then
243260
echo "Tag $TAG exists, skipping creation."
244261
else
245-
git tag "$TAG"
262+
git tag -s "$TAG" -m "Upstream release $TAG"
246263
git push origin "$TAG"
247-
echo "New tag $TAG created and pushed."
264+
echo "New signed tag $TAG created and pushed."
248265
fi
249266
250267
- name: Create GitHub Release

0 commit comments

Comments
 (0)