Skip to content

Commit 7b98442

Browse files
author
Waldek Herka
committed
feat: add RPM/DEB package builds for amd64, arm64, 386, arm
1 parent 601632a commit 7b98442

File tree

3 files changed

+322
-48
lines changed

3 files changed

+322
-48
lines changed

.github/workflows/release.yml

Lines changed: 51 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
name: Release
22

33
on:
4-
push:
5-
tags:
6-
- 'v*'
4+
release:
5+
types: [prereleased]
76

87
permissions:
98
contents: write
@@ -20,32 +19,63 @@ jobs:
2019
uses: actions/setup-go@v5
2120
with:
2221
go-version: '1.21'
23-
cache: false # Avoid cache conflict with gh-extension-precompile
22+
cache: true
23+
24+
- name: Install tools (if needed)
25+
run: |
26+
# Check if envsubst is available, install only if missing
27+
if ! command -v envsubst &> /dev/null; then
28+
echo "envsubst not found, installing gettext-base..."
29+
sudo apt-get update && sudo apt-get install -y gettext-base
30+
else
31+
echo "envsubst is already available"
32+
fi
2433
2534
- name: Run tests
2635
run: go test ./...
2736

28-
- name: Prepare Release
29-
env:
30-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
- name: Build release binaries and packages
3138
run: |
32-
# Delete existing release if it exists (allows re-running)
33-
gh release delete ${{ github.ref_name }} --yes 2>/dev/null || true
39+
# Set version from tag (strip 'v' prefix for package version)
40+
VERSION="${GITHUB_REF_NAME#v}"
41+
export VERSION
42+
export RPM_RELEASE=1
43+
echo "Building version: $VERSION"
44+
echo "RPM release: $RPM_RELEASE"
3445
35-
# Create draft release with generated notes (precompile will add assets)
36-
gh release create ${{ github.ref_name }} \
37-
--title "🚀 ${{ github.ref_name }}" \
38-
--generate-notes \
39-
--draft=true
46+
make release packages
4047
41-
- name: Create cross-platform builds
42-
uses: cli/gh-extension-precompile@v2
43-
with:
44-
go_version: "1.21"
48+
# List all built artifacts
49+
echo ""
50+
echo "=== Built artifacts ==="
51+
ls -lh dist/
52+
53+
# Display package metadata
54+
echo "=== DEB Package Info ==="
55+
for deb in dist/*.deb; do
56+
echo "--- $deb ---"
57+
dpkg-deb -I "$deb" | grep -E "(Package|Version|Architecture|Maintainer)"
58+
done
4559
46-
- name: Publish Release
60+
echo ""
61+
echo "=== RPM Package Info ==="
62+
for rpm in dist/*.rpm; do
63+
echo "--- $rpm ---"
64+
rpm -qip "$rpm" 2>/dev/null | grep -E "(Name|Version|Release|Architecture|Group)" || \
65+
echo "rpm command not available for detailed info"
66+
done
67+
- name: Upload artifacts and set release as latest
4768
env:
4869
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4970
run: |
50-
# Publish the draft release
51-
gh release edit ${{ github.ref_name }} --draft=false
71+
VERSION="${{ github.event.release.tag_name }}"
72+
73+
# Note: the relase is assumed as created as prerelease
74+
# The following section is aimmed at pushing the artifacts to the release
75+
# and promoting it to latest
76+
77+
echo "Uploading artifacts to release $VERSION..."
78+
gh release upload "$VERSION" dist/gh-app-auth* --clobber
79+
80+
echo "Setting release as latest..."
81+
gh release edit "$VERSION" --prerelease=false --latest

0 commit comments

Comments
 (0)