Skip to content

Commit c39be10

Browse files
committed
gha: Sign release tarballs and binary branch commits
1 parent f04a5eb commit c39be10

File tree

1 file changed

+37
-8
lines changed

1 file changed

+37
-8
lines changed

.github/workflows/release.yml

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,28 @@ jobs:
1313

1414
steps:
1515
- name: Install dependencies
16-
run: pacman --noconfirm -Syu && pacman --needed --noconfirm -S base-devel gzip bzip2 lzip zstd git autoconf automake nasm curl mtools llvm clang lld mingw-w64-gcc
16+
run: pacman --noconfirm -Syu && pacman --needed --noconfirm -S base-devel gnupg gzip bzip2 lzip zstd git autoconf automake nasm curl mtools llvm clang lld mingw-w64-gcc
17+
18+
- name: Import GPG public key
19+
run: gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 05D29860D0A0668AAEFB9D691F3C021BECA23821
20+
21+
- name: Import GPG private key
22+
run: echo "$MINTSUKI_PRIVATE_KEY" | gpg --batch --import
23+
env:
24+
MINTSUKI_PRIVATE_KEY: ${{ secrets.MINTSUKI_PRIVATE_KEY }}
1725

1826
- name: Checkout code
1927
uses: actions/checkout@v4
2028
with:
2129
fetch-depth: '0'
2230

2331
- name: Git config
24-
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
32+
run: |
33+
set -e
34+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
35+
git config --global user.name 'Mintsuki'
36+
git config --global user.email 'mintsuki@protonmail.com'
37+
git config --global user.signingkey 05D29860D0A0668AAEFB9D691F3C021BECA23821
2538
2639
- name: Get tag name
2740
run: echo "TAG_NAME=$(git describe --exact-match --tags $(git log -n1 --pretty='%h'))" >> $GITHUB_ENV
@@ -64,16 +77,15 @@ jobs:
6477

6578
- name: Push binaries to binary branch
6679
run: |
67-
git config user.name 'mintsuki'
68-
git config user.email 'mintsuki@users.noreply.github.com'
80+
set -e
6981
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/limine-bootloader/limine.git
7082
git fetch --all
7183
git checkout $BRANCH_NAME-binary || git checkout --orphan $BRANCH_NAME-binary
7284
rm -rf $(ls -a | grep -v '^\.git$' | grep -v '^\.\.$' | grep -v '^\.$' | grep -v '^build$')
7385
cp -r build/bin/. ./
7486
rm -rf build
7587
git add -f .
76-
git commit -m "Binary release $TAG_NAME"
88+
git commit -m "Binary release $TAG_NAME" -S
7789
git push origin $BRANCH_NAME-binary
7890
git tag $TAG_NAME-binary
7991
git push origin $BRANCH_NAME-binary --tags
@@ -84,11 +96,28 @@ jobs:
8496
- name: Package release tarball
8597
run: ./bootstrap && ./configure --enable-all && make dist
8698

99+
- name: Sign release tarball
100+
run: gpg --batch --default-key 05D29860D0A0668AAEFB9D691F3C021BECA23821 --detach-sign limine-*.tar.*
101+
87102
- name: Create release notes
88103
run: |
89-
echo "Changelog can be found [here](https://github.com/limine-bootloader/limine/releases/download/$TAG_NAME/ChangeLog)." > rel_notes.txt
90-
echo "" >> rel_notes.txt
91-
echo "Binary release can be found [here](https://github.com/limine-bootloader/limine/tree/$TAG_NAME-binary)." >> rel_notes.txt
104+
cat <<'EOF' >rel_notes.txt
105+
Changelog can be found [here](https://github.com/limine-bootloader/limine/releases/download/$TAG_NAME/ChangeLog).
106+
107+
Binary release can be found [here](https://github.com/limine-bootloader/limine/tree/$TAG_NAME-binary).
108+
109+
Tarballs are signed using key ID 05D29860D0A0668AAEFB9D691F3C021BECA23821 which can be obtained from the keyservers: keys.openpgp.org, keyring.debian.org, keyserver.ubuntu.com.
110+
111+
Import the public key with:
112+
```bash
113+
gpg --keyserver <a keyserver from list above> --recv-keys 05D29860D0A0668AAEFB9D691F3C021BECA23821
114+
```
115+
116+
In order to verify the tarball with the given signature, do:
117+
```bash
118+
gpg --verify <tarball sig file> <associated tarball>
119+
```
120+
EOF
92121
93122
- name: Release
94123
uses: softprops/action-gh-release@v2

0 commit comments

Comments
 (0)