Skip to content

Commit 0cfbd86

Browse files
tedim52claude
andauthored
chore: publish deb/rpm artifacts to GitHub Pages (#2918)
## Summary This P adds adds apt/rpm package distribution with a self-hosted repository on GitHub Pages using the existing `kurtosis-cli-release-artifacts` repo. **Key Changes:** - Add new workflow job to generate apt/rpm repository metadata on GitHub Pages - Fix goreleaser release IDs to properly upload deb/rpm files to GitHub Releases **New Repository URL:** ``` https://kurtosis-tech.github.io/kurtosis-cli-release-artifacts/ ``` ## User Facing YES - Updated installation instructions for users 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4672313 commit 0cfbd86

File tree

2 files changed

+94
-5
lines changed

2 files changed

+94
-5
lines changed
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Update Package Repository
2+
3+
on:
4+
# Run automatically after a successful publish
5+
workflow_run:
6+
workflows: ["Publish"]
7+
types: [completed]
8+
9+
# Allow manual trigger
10+
workflow_dispatch:
11+
inputs:
12+
version:
13+
description: 'Release version to publish (e.g. 1.16.4)'
14+
required: true
15+
16+
jobs:
17+
update-package-repo:
18+
runs-on: ubuntu-latest
19+
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
20+
steps:
21+
- name: Determine version
22+
id: version
23+
run: |
24+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
25+
echo "version=${{ github.event.inputs.version }}" >> "$GITHUB_OUTPUT"
26+
else
27+
# Get the tag from the workflow run that triggered us
28+
echo "version=${{ github.event.workflow_run.head_branch }}" >> "$GITHUB_OUTPUT"
29+
fi
30+
31+
- name: Install repo tools
32+
run: |
33+
sudo apt-get update
34+
sudo apt-get install -y dpkg-dev createrepo-c
35+
36+
- name: Checkout existing GitHub Pages
37+
uses: actions/checkout@v4
38+
with:
39+
repository: kurtosis-tech/kurtosis-cli-release-artifacts
40+
ref: gh-pages
41+
token: ${{ secrets.KURTOSISBOT_GITHUB_TOKEN }}
42+
path: repo
43+
44+
- name: Download deb/rpm from release
45+
env:
46+
GH_TOKEN: ${{ secrets.KURTOSISBOT_GITHUB_TOKEN }}
47+
run: |
48+
set -euo pipefail
49+
version="${{ steps.version.outputs.version }}"
50+
51+
mkdir -p downloads
52+
gh release download "${version}" \
53+
--repo kurtosis-tech/kurtosis-cli-release-artifacts \
54+
--pattern '*.deb' \
55+
--pattern '*.rpm' \
56+
--dir downloads
57+
58+
echo "Downloaded artifacts:"
59+
ls -la downloads/
60+
61+
- name: Update apt repository
62+
run: |
63+
set -euo pipefail
64+
cd repo
65+
66+
# Flat repo layout: debs and Packages file at the root (like Gemfury)
67+
cp ../downloads/*.deb .
68+
69+
# Generate Packages index for all deb files in the root
70+
dpkg-scanpackages --multiversion . > Packages
71+
gzip -9c Packages > Packages.gz
72+
73+
- name: Update rpm repository
74+
run: |
75+
set -euo pipefail
76+
cd repo
77+
78+
mkdir -p rpm/packages
79+
cp ../downloads/*.rpm rpm/packages/
80+
81+
createrepo_c --update rpm/
82+
83+
- name: Deploy to GitHub Pages
84+
uses: peaceiris/actions-gh-pages@v4
85+
with:
86+
personal_token: ${{ secrets.KURTOSISBOT_GITHUB_TOKEN }}
87+
external_repository: kurtosis-tech/kurtosis-cli-release-artifacts
88+
publish_dir: ./repo
89+
keep_files: true
90+
user_name: kurtosisbot
91+
user_email: kurtosisbot@kurtosistech.com
92+
commit_message: "Update package repo for ${{ steps.version.outputs.version }}"

cli/cli/.goreleaser.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ archives:
5252
- scripts/completions/scripts/*
5353
name_template: kurtosis-cli_{{ .Version }}_{{ .Os }}_{{ .Arch }}
5454

55-
# Gemfury accepts deb & rpm packages but not APK, so we build these two separately
5655
nfpms:
5756
- id: deb-and-rpm-packages
5857
package_name: kurtosis-cli
@@ -84,10 +83,10 @@ release:
8483

8584
name_template: "{{ .Version }}"
8685

87-
# NOTE: these are the archive IDs, not the build/binary IDs
8886
ids:
8987
- cli
9088
- cli-linux-packages
89+
- deb-and-rpm-packages
9190

9291
brews:
9392
# creates a brew formula representing the latest version
@@ -141,15 +140,13 @@ brews:
141140
The kurtosis CLI is installed with tab completion support. For more details visit https://docs.kurtosis.com/.
142141
143142
publishers:
144-
# Inspired by https://netdevops.me/2021/building-and-publishing-deb/rpm-packages-with-goreleaser-and-fury.io/
145143
- name: fury.io
146144
ids:
147145
- deb-and-rpm-packages
148146
dir: "{{ dir .ArtifactPath }}"
149147
env:
150-
# This will get set by CI; see the CI config for how
151148
- 'FURY_TOKEN={{ .Env.FURY_TOKEN }}'
152-
cmd: "curl -F package=@{{ .ArtifactName }} https://{{ .Env.FURY_TOKEN }}@push.fury.io/kurtosis-tech/"
149+
cmd: "curl --fail -F package=@{{ .ArtifactName }} https://{{ .Env.FURY_TOKEN }}@push.fury.io/kurtosis-tech/"
153150

154151
source:
155152
# Kurt Core is a private project, and we definitely don't want to release source code

0 commit comments

Comments
 (0)