Skip to content

Commit db15968

Browse files
authored
fix: archlinux packaging issues (#57)
Fixes #56
1 parent 57865a9 commit db15968

File tree

4 files changed

+40
-2
lines changed

4 files changed

+40
-2
lines changed

.github/workflows/go-build.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ name: generic-go-versionbuild
22

33
on:
44
workflow_call:
5+
secrets:
6+
GPG_PRIVATE_KEY:
7+
required: true
8+
GPG_PASSPHRASE:
9+
required: true
510
inputs:
611
service:
712
required: true
@@ -165,11 +170,24 @@ jobs:
165170
merge-multiple: true
166171

167172
- name: package with nfpm
173+
env:
174+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
175+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
176+
GPG_KEY_ID: [email protected]
168177
run: |
169178
mkdir -p dist
170179
nfpm pkg --packager archlinux --config nfpm.yaml --target dist/
171180
nfpm pkg --packager deb --config nfpm.yaml --target dist/
172181
182+
# sign the package for arch linux
183+
test -n "$GPG_PRIVATE_KEY" || { echo "GPG_PRIVATE_KEY is empty"; exit 1; }
184+
printf '%s' "$GPG_PRIVATE_KEY" | gpg --batch --import
185+
gpg --batch --list-secret-keys --keyid-format LONG
186+
187+
FPR="$(gpg --batch --list-secret-keys --with-colons | awk -F: '$1=="fpr"{print $10; exit}')"
188+
189+
gpg --batch --yes --local-user "$FPR" --pinentry-mode loopback --passphrase "$GPG_PASSPHRASE" --detach-sign dist/*.pkg.tar.zst
190+
173191
- name: upload build artifact
174192
uses: actions/upload-artifact@v4
175193
with:

.github/workflows/go-ssh-keysign-workflow.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,6 @@ jobs:
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 }}
29+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@
55
**/node_modules/
66
**/*ca_key*
77
src/**
8+
9+
# ignore test nfpm packages
10+
dist/**

nfpm.yaml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
11
name: ssh-keysign
22
arch: amd64
33
platform: linux
4-
version: 0.0.7
4+
version: 0.0.8
55
section: default
66
priority: extra
77
maintainer: Sujoy Das <[email protected]>
88
description: Generate short lived, oauth verified, SSH certficates on the fly
9+
license: GPL v3.0
10+
homepage: https://github.com/binarycodes/ssh-key-signer
11+
12+
archlinux:
13+
packager: Sujoy Das <[email protected]>
14+
pkgbase: ssh-keysign
15+
916
contents:
1017
- src: ./go-ssh-keysign/bin/ssh-keysign-linux-amd64
11-
dst: /usr/local/bin/ssh-keysign
18+
dst: /usr/bin/ssh-keysign
19+
file_info:
20+
mode: 0755
21+
owner: root
22+
group: root
23+
24+
- src: ./LICENSE
25+
dst: /usr/share/licenses/ssh-keysign/LICENSE

0 commit comments

Comments
 (0)