feat(ci): add multi-architecture support for OS package builds (#2610)

This commit is contained in:
kolaente 2026-04-12 12:24:08 +02:00 committed by GitHub
parent 85cfadc5b0
commit 1cde0a1705
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 31 additions and 22 deletions

View File

@ -152,6 +152,16 @@ jobs:
- deb
- apk
- archlinux
arch:
- go_name: linux-amd64
nfpm: amd64
pkg: x86_64
- go_name: linux-arm64
nfpm: arm64
pkg: aarch64
- go_name: linux-arm-7
nfpm: arm7
pkg: armv7
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
@ -159,7 +169,6 @@ jobs:
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
with:
name: vikunja_bins
pattern: vikunja-*-linux-amd64
- name: Git describe
id: ghd
uses: proudust/gh-describe@v2
@ -170,18 +179,19 @@ jobs:
- name: Prepare
env:
RELEASE_VERSION: ${{ steps.ghd.outputs.describe }}
NFPM_ARCH: ${{ matrix.arch.nfpm }}
run: |
chmod +x ./mage-static
./mage-static release:prepare-nfpm-config
mkdir -p ./dist/os-packages
mv ./vikunja-*-linux-amd64 ./vikunja
mv ./vikunja-*-${{ matrix.arch.go_name }} ./vikunja
chmod +x ./vikunja
- name: Create package
id: nfpm
uses: kolaente/action-gh-nfpm@master
with:
packager: ${{ matrix.package }}
target: ./dist/os-packages/vikunja-${{ github.ref_type == 'tag' && steps.ghd.outputs.describe || 'unstable' }}-x86_64.${{ matrix.package }}
target: ./dist/os-packages/vikunja-${{ github.ref_type == 'tag' && steps.ghd.outputs.describe || 'unstable' }}-${{ matrix.arch.pkg }}.${{ matrix.package }}
config: ./nfpm.yaml
- name: Upload
uses: kolaente/s3-action@41963184b524ccac734ea4d8c964ac74b5b1af89 # v1.2.1
@ -198,7 +208,7 @@ jobs:
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
if: ${{ github.ref_type == 'tag' }}
with:
name: vikunja_os_package_${{ matrix.package }}
name: vikunja_os_package_${{ matrix.package }}_${{ matrix.arch.pkg }}
path: ./dist/os-packages/*
config-yaml:
@ -347,25 +357,11 @@ jobs:
with:
name: vikunja_bin_packages
- name: Download OS Package rpm
- name: Download OS Packages
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
with:
name: vikunja_os_package_rpm
- name: Download OS Package deb
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
with:
name: vikunja_os_package_deb
- name: Download OS Package apk
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
with:
name: vikunja_os_package_apk
- name: Download OS Package archlinux
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
with:
name: vikunja_os_package_archlinux
pattern: vikunja_os_package_*
merge-multiple: true
- name: Download Desktop Package Linux
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7

View File

@ -1215,8 +1215,21 @@ func (Release) PrepareNFPMConfig() error {
return err
}
var nfpmArch string
switch os.Getenv("NFPM_ARCH") {
case "arm64":
nfpmArch = "arm64"
case "arm7":
nfpmArch = "arm7"
case "386":
nfpmArch = "386"
default:
nfpmArch = "amd64"
}
fixedConfig := strings.ReplaceAll(string(nfpmconfig), "<version>", VersionNumber)
fixedConfig = strings.ReplaceAll(fixedConfig, "<binlocation>", BinLocation)
fixedConfig = strings.ReplaceAll(fixedConfig, "<arch>", nfpmArch)
if err := os.WriteFile(nfpmConfigPath, []byte(fixedConfig), 0); err != nil {
return err
}

View File

@ -1,5 +1,5 @@
name: "vikunja"
arch: "amd64"
arch: "<arch>"
platform: "linux"
version: "<version>"
description: "Vikunja is an open-source todo application, written in Go. It lets you create lists,tasks and share them via teams or directly between users."