Skip to content

Commit af875da

Browse files
authored
fix!: dpkg-sig and pin ubuntu (#16)
* fix!: setup-gpg: remove dpkg-sig and dpkg-dev packages dpkg-sig and dpkg-dev are not available on ubuntu24, which is the new 'ubuntu-latest' * fix!: pin example workflows to ubuntu-22 * fix: manually install dpkg-sig,dkpg-dev in deb workflow
1 parent ed780e9 commit af875da

File tree

4 files changed

+82
-80
lines changed

4 files changed

+82
-80
lines changed

.github/workflows/sign-deb-example.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ on:
66
- main
77
jobs:
88
sign-deb:
9-
runs-on: ubuntu-latest
9+
runs-on: ubuntu-22.04
1010
steps:
1111
- uses: actions/checkout@master
12-
12+
- name: install dpkg-sig
13+
run: |
14+
sudo apt-get install dpkg-sig dpkg-dev
1315
- name: setup GPG
1416
uses: ./devops/setup-gpg
1517
with:

.github/workflows/sign-file-example.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- main
77
jobs:
88
sign-deb:
9-
runs-on: ubuntu-latest
9+
runs-on: ubuntu-22.04
1010
steps:
1111
- uses: actions/checkout@master
1212

.github/workflows/sign-rpm-example.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- main
77
jobs:
88
sign-rpm:
9-
runs-on: ubuntu-latest
9+
runs-on: ubuntu-22.04
1010
steps:
1111
- uses: actions/checkout@master
1212

devops/setup-gpg/action.yaml

Lines changed: 76 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,90 @@
1-
name: 'Setup GPG'
2-
description: 'Configures this action to run gpg with a given key and pass'
1+
name: "Setup GPG"
2+
description: "Configures this action to run gpg with a given key and pass"
33
inputs:
4-
gpg-private-key: # id of input
4+
gpg-private-key: # id of input
55
required: true
6-
gpg-key-pass: # id of input
6+
gpg-key-pass: # id of input
77
required: true
8-
gpg-key-name: # id of input
8+
gpg-key-name: # id of input
99
required: true
1010
default: "Aerospike"
1111
gpg-public-key:
12-
description: 'GPG public key exported as an ASCII armored version or its base64 encoding'
12+
description: "GPG public key exported as an ASCII armored version or its base64 encoding"
1313
required: true
1414
runs:
1515
using: "composite"
1616
steps:
17-
- name: "check if private key is not empty"
18-
env:
19-
PRIVATE_KEY: ${{ inputs.gpg-private-key }}
20-
if: ${{ env.PRIVATE_KEY == '' }}
21-
run: |
22-
echo "the gpg-private-key was empty"
23-
exit 1
24-
shell: bash
25-
- name: "check if key name is not empty"
26-
env:
27-
KEY_NAME: ${{ inputs.gpg-key-name }}
28-
if: ${{ env.KEY_NAME == '' }}
29-
run: |
30-
echo "the gpg-key-name was empty"
31-
exit 1
32-
shell: bash
33-
- name: "check if key pass is not empty"
34-
env:
35-
KEY_PASS: ${{ inputs.gpg-key-pass }}
36-
if: ${{ env.KEY_PASS == '' }}
37-
run: |
38-
echo "the secret gpg-key-pass was empty"
39-
exit 1
40-
shell: bash
41-
- name: "check if public key pass is empty"
42-
env:
43-
PUBLIC_KEY: ${{ inputs.gpg-public-key }}
44-
if: ${{ env.PUBLIC_KEY == '' }}
45-
run: |
46-
echo "the secret gpg-public-pass was empty"
47-
exit 1
48-
shell: bash
49-
- name: install tools
50-
run: |
51-
sudo apt-get update && sudo apt-get install ca-certificates gnupg dpkg-dev dpkg-sig rpm -y
52-
shell: bash
53-
- name: Set up GPG
54-
env:
55-
GPG_PRIVATE_KEY: ${{ inputs.gpg-private-key }}
56-
GPG_KEY_PASS: ${{ inputs.gpg-key-pass }}
57-
GPG_ID: ${{ inputs.gpg-key-name }}
58-
GPG_PUBLIC_KEY: ${{ inputs.gpg-public-key }}
59-
run: |
60-
# Setup gpg
61-
mkdir -p ~/.gnupg
62-
chmod 700 ~/.gnupg
63-
echo "$GPG_PRIVATE_KEY" | gpg --import --batch --yes
64-
echo "$GPG_KEY_PASS"
17+
- name: "check if private key is not empty"
18+
env:
19+
PRIVATE_KEY: ${{ inputs.gpg-private-key }}
20+
if: ${{ env.PRIVATE_KEY == '' }}
21+
run: |
22+
echo "the gpg-private-key was empty"
23+
exit 1
24+
shell: bash
25+
- name: "check if key name is not empty"
26+
env:
27+
KEY_NAME: ${{ inputs.gpg-key-name }}
28+
if: ${{ env.KEY_NAME == '' }}
29+
run: |
30+
echo "the gpg-key-name was empty"
31+
exit 1
32+
shell: bash
33+
- name: "check if key pass is not empty"
34+
env:
35+
KEY_PASS: ${{ inputs.gpg-key-pass }}
36+
if: ${{ env.KEY_PASS == '' }}
37+
run: |
38+
echo "the secret gpg-key-pass was empty"
39+
exit 1
40+
shell: bash
41+
- name: "check if public key pass is empty"
42+
env:
43+
PUBLIC_KEY: ${{ inputs.gpg-public-key }}
44+
if: ${{ env.PUBLIC_KEY == '' }}
45+
run: |
46+
echo "the secret gpg-public-pass was empty"
47+
exit 1
48+
shell: bash
49+
- name: install tools
50+
run: |
51+
sudo apt-get update && sudo apt-get install ca-certificates gnupg rpm -y
52+
shell: bash
53+
- name: Set up GPG
54+
env:
55+
GPG_PRIVATE_KEY: ${{ inputs.gpg-private-key }}
56+
GPG_KEY_PASS: ${{ inputs.gpg-key-pass }}
57+
GPG_ID: ${{ inputs.gpg-key-name }}
58+
GPG_PUBLIC_KEY: ${{ inputs.gpg-public-key }}
59+
run: |
60+
# Setup gpg
61+
mkdir -p ~/.gnupg
62+
chmod 700 ~/.gnupg
63+
echo "$GPG_PRIVATE_KEY" | gpg --import --batch --yes
64+
echo "$GPG_KEY_PASS"
6565
66-
# configure for non-interactive use
67-
export GPG_TTY=no-tty
68-
echo -e "pinentry-mode loopback\nuse-agent" >> ~/.gnupg/gpg.conf
69-
echo -e "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf
66+
# configure for non-interactive use
67+
export GPG_TTY=no-tty
68+
echo -e "pinentry-mode loopback\nuse-agent" >> ~/.gnupg/gpg.conf
69+
echo -e "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf
7070
71-
# configure rpm's
72-
echo -e "$GPG_KEY_PASS" >> ~/pass
73-
echo -e "%_signature gpg" >> ~/.rpmmacros
74-
echo -e "%_gpg_path ~/.gnupg" >> ~/.rpmmacros
75-
echo -e "%_gpg_name $GPG_ID" >> ~/.rpmmacros
76-
echo -e "%_gpgbin /usr/bin/gpg" >> ~/.rpmmacros
77-
echo -e "%__gpg /usr/bin/gpg" >> ~/.rpmmacros
78-
echo -e "%__gpg_sign_cmd %{__gpg} \\" >> ~/.rpmmacros
79-
echo -e "gpg --no-verbose --batch --no-tty --passphrase-file /home/runner/pass --pinentry-mode loopback \\" >> ~/.rpmmacros
80-
echo -e " %{?_gpg_digest_algo:--digest-algo %{_gpg_digest_algo}} \\" >> ~/.rpmmacros
81-
echo -e " --no-secmem-warning \\" >> ~/.rpmmacros
82-
echo -e " -u '%{_gpg_name}' -sbo %{__signature_filename} %{__plaintext_filename}" >> ~/.rpmmacros
71+
# configure rpm's
72+
echo -e "$GPG_KEY_PASS" >> ~/pass
73+
echo -e "%_signature gpg" >> ~/.rpmmacros
74+
echo -e "%_gpg_path ~/.gnupg" >> ~/.rpmmacros
75+
echo -e "%_gpg_name $GPG_ID" >> ~/.rpmmacros
76+
echo -e "%_gpgbin /usr/bin/gpg" >> ~/.rpmmacros
77+
echo -e "%__gpg /usr/bin/gpg" >> ~/.rpmmacros
78+
echo -e "%__gpg_sign_cmd %{__gpg} \\" >> ~/.rpmmacros
79+
echo -e "gpg --no-verbose --batch --no-tty --passphrase-file /home/runner/pass --pinentry-mode loopback \\" >> ~/.rpmmacros
80+
echo -e " %{?_gpg_digest_algo:--digest-algo %{_gpg_digest_algo}} \\" >> ~/.rpmmacros
81+
echo -e " --no-secmem-warning \\" >> ~/.rpmmacros
82+
echo -e " -u '%{_gpg_name}' -sbo %{__signature_filename} %{__plaintext_filename}" >> ~/.rpmmacros
8383
84-
# public key for verification
85-
echo -e "$GPG_PUBLIC_KEY" >> ~/.gnupg/.public_key.asc
86-
rpm --import ~/.gnupg/.public_key.asc
84+
# public key for verification
85+
echo -e "$GPG_PUBLIC_KEY" >> ~/.gnupg/.public_key.asc
86+
rpm --import ~/.gnupg/.public_key.asc
8787
88-
# reload agent
89-
gpg-connect-agent reloadagent /bye
90-
shell: bash
88+
# reload agent
89+
gpg-connect-agent reloadagent /bye
90+
shell: bash

0 commit comments

Comments
 (0)