Add Alpine APK packaging and update CI for versioned releases
This commit is contained in:
60
.gitea/workflows/apk-publish.yml
Normal file
60
.gitea/workflows/apk-publish.yml
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
name: Build and Publish APK Package
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-apk:
|
||||||
|
runs-on:
|
||||||
|
- ubuntu-24.04
|
||||||
|
container:
|
||||||
|
image: alpine:latest
|
||||||
|
steps:
|
||||||
|
- name: Install build dependencies
|
||||||
|
run: |
|
||||||
|
apk add --no-cache git go abuild make
|
||||||
|
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup abuild for package signing
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.abuild
|
||||||
|
echo "PACKAGER_PRIVKEY=/home/runner/.abuild/private_key.rsa" > ~/.abuild/abuild.conf
|
||||||
|
echo "PACKAGER_PUBKEY=/home/runner/.abuild/private_key.rsa.pub" >> ~/.abuild/abuild.conf
|
||||||
|
openssl genrsa -out ~/.abuild/private_key.rsa 2048
|
||||||
|
openssl rsa -pubout -in ~/.abuild/private_key.rsa -out ~/.abuild/private_key.rsa.pub
|
||||||
|
abuild-keygen -a -n
|
||||||
|
|
||||||
|
- name: Prepare source
|
||||||
|
run: |
|
||||||
|
cd packaging/alpine
|
||||||
|
pkgver=$(echo "${{ github.ref_name }}" | sed 's/^v//')
|
||||||
|
sed -i "s/pkgver=.*/pkgver=$pkgver/" APKBUILD
|
||||||
|
sed -i "s|source=.*|source=\"\$pkgname-\$pkgver.tar.gz::${{ github.server_url }}/${{ github.repository }}/archive/\$pkgver.tar.gz\"|" APKBUILD
|
||||||
|
|
||||||
|
- name: Generate checksums
|
||||||
|
run: |
|
||||||
|
cd packaging/alpine
|
||||||
|
abuild checksum
|
||||||
|
|
||||||
|
- name: Build package
|
||||||
|
run: |
|
||||||
|
cd packaging/alpine
|
||||||
|
abuild -r
|
||||||
|
|
||||||
|
- name: Find built package
|
||||||
|
id: find_package
|
||||||
|
run: |
|
||||||
|
find /home/runner/packages -name "*.apk" -type f > packages.txt
|
||||||
|
echo "package_path=$(head -1 packages.txt)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Publish to Gitea Registry
|
||||||
|
run: |
|
||||||
|
apk_file=$(find /home/runner/packages -name "*.apk" -type f | head -1)
|
||||||
|
branch=$(echo "${{ github.ref_name }}" | sed 's/^v//')
|
||||||
|
curl -X PUT \
|
||||||
|
-H "Authorization: token ${{ secrets.ACCESS_TOKEN }}" \
|
||||||
|
-T "$apk_file" \
|
||||||
|
"${{ github.api_url }}/packages/${{ github.repository_owner }}/apk/${{ github.repository }}/$branch"
|
||||||
@@ -1,9 +1,8 @@
|
|||||||
# .gitea/workflows/docker-build.yml
|
|
||||||
name: Build and Push Docker Container
|
name: Build and Push Docker Container
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
tags:
|
||||||
- "*"
|
- 'v*'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
@@ -24,4 +23,4 @@ jobs:
|
|||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
tags: "g.eliaskohout.de/eliaskohout/ax-server:${{gitea.sha}},g.eliaskohout.de/eliaskohout/ax-server:latest"
|
tags: "g.eliaskohout.de/eliaskohout/ax-server:${{gitea.ref_name}},g.eliaskohout.de/eliaskohout/ax-server:latest"
|
||||||
|
|||||||
26
packaging/alpine/APKBUILD
Normal file
26
packaging/alpine/APKBUILD
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
# Maintainer: Elias Kohout <elias@kohout.eu>
|
||||||
|
pkgname=axolotl
|
||||||
|
pkgver=0.1.0
|
||||||
|
pkgrel=0
|
||||||
|
pkgdesc="CLI-native issue tracker using SQLite"
|
||||||
|
url="https://g.eliaskohout.de/eliaskohout/axolotl"
|
||||||
|
arch="x86_64 aarch64"
|
||||||
|
license="MIT"
|
||||||
|
depends=""
|
||||||
|
makedepends="go"
|
||||||
|
source="$pkgname-$pkgver.tar.gz::https://g.eliaskohout.de/eliaskohout/axolotl/archive/$pkgver.tar.gz"
|
||||||
|
|
||||||
|
export GOTOOLCHAIN=auto
|
||||||
|
|
||||||
|
build() {
|
||||||
|
cd "$srcdir/src"
|
||||||
|
go build -ldflags="-s -w" -trimpath -o "$pkgname" .
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
install -Dm755 "$srcdir/src/$pkgname" "$pkgdir/usr/bin/$pkgname"
|
||||||
|
|
||||||
|
ln -s "$pkgname" "$pkgdir/usr/bin/ax"
|
||||||
|
}
|
||||||
|
|
||||||
|
sha512sums=""
|
||||||
Reference in New Issue
Block a user