Skip to content

Commit d659001

Browse files
committed
chore(ci/cd): split apt publishing from release pipeline
1 parent 9dfc1f3 commit d659001

File tree

2 files changed

+40
-7
lines changed

2 files changed

+40
-7
lines changed

.github/workflows/release.yaml

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,26 @@ jobs:
2121
runs-on: macOS-latest
2222
env:
2323
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
24-
# Needed to publish new packages to our S3-hosted APT repo
25-
AWS_ACCESS_KEY_ID: ${{ secrets.OBJECT_STORAGE_ACCESS_KEY_ID }}
26-
AWS_SECRET_ACCESS_KEY: ${{ secrets.OBJECT_STORAGE_SECRET_ACCESS_KEY }}
2724
steps:
2825
- name: Checkout
2926
uses: actions/checkout@v5
3027
with:
3128
# Allow goreleaser to access older tag information.
3229
fetch-depth: 0
30+
3331
- name: Install go
3432
uses: actions/setup-go@v5
3533
with:
3634
go-version-file: "go.mod"
3735
cache: true
36+
3837
- name: Import GPG key
3938
uses: crazy-max/ghaction-import-gpg@v6
4039
id: import_gpg
4140
with:
4241
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
4342
passphrase: ${{ secrets.GPG_PASSPHRASE }}
43+
4444
- name: Set up keychain
4545
run: |
4646
echo -n $SIGNING_CERTIFICATE_BASE64 | base64 -d -o ./ApplicationID.p12
@@ -61,17 +61,52 @@ jobs:
6161
APPLE_KEY_ID: ${{ secrets.APPLE_KEY_ID }}
6262
SIGNING_CERTIFICATE_BASE64: ${{ secrets.APPLICATION_ID_CERT }}
6363
AUTHKEY_BASE64: ${{ secrets.APPLE_API_KEY }}
64-
- name: Install Aptly
65-
run: brew install aptly
6664
- name: Install Snapcraft
6765
uses: samuelmeuli/action-snapcraft@v3
66+
6867
- name: Run GoReleaser
6968
uses: goreleaser/goreleaser-action@v6
7069
with:
7170
args: release --clean
7271
env:
7372
GITHUB_TOKEN: ${{ secrets.CLI_RELEASE }}
7473
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
74+
75+
- name: Upload artifacts to workflow
76+
uses: actions/upload-artifact@v4
77+
with:
78+
name: goreleaser-dist-temp
79+
path: dist
80+
retention-days: 1
81+
82+
publish-apt:
83+
name: Publish APT
84+
runs-on: ubuntu-latest
85+
needs: []
86+
env:
87+
# Needed to publish new packages to our S3-hosted APT repo
88+
AWS_ACCESS_KEY_ID: ${{ secrets.OBJECT_STORAGE_ACCESS_KEY_ID }}
89+
AWS_SECRET_ACCESS_KEY: ${{ secrets.OBJECT_STORAGE_SECRET_ACCESS_KEY }}
90+
steps:
91+
- name: Checkout
92+
uses: actions/checkout@v5
93+
94+
- name: Download artifact
95+
uses: actions/download-artifact@v4
96+
with:
97+
name: goreleaser-dist-temp
98+
path: dist
99+
100+
- name: Install Aptly
101+
run: brew install aptly
102+
103+
- name: Import GPG key
104+
uses: crazy-max/ghaction-import-gpg@v6
105+
id: import_gpg
106+
with:
107+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
108+
passphrase: ${{ secrets.GPG_PASSPHRASE }}
109+
75110
- name: Publish packages to APT repo
76111
if: contains(github.ref_name, '-') == false
77112
env:

scripts/publish-apt-packages.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
# Usage: ./publish-apt-packages.sh
55
set -eo pipefail
66

7-
ROOT_DIR=$(git rev-parse --show-toplevel)
8-
97
PACKAGES_BUCKET_URL="https://packages.stackit.cloud"
108
PUBLIC_KEY_FILE_PATH="keys/key.gpg"
119
APT_REPO_PATH="apt/cli"

0 commit comments

Comments
 (0)