ci: build and upload .deb packages on release
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
name: Build deb packages on release
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
build-deb:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: catthehacker/ubuntu:act-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install build dependencies
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y --no-install-recommends dpkg-dev
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
cache: true
|
||||
|
||||
- name: Derive version from tag
|
||||
id: ver
|
||||
run: |
|
||||
TAG="${GITEA_REF_NAME:-${GITHUB_REF_NAME}}"
|
||||
VERSION="${TAG#v}"
|
||||
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
||||
echo "Building version: ${VERSION}"
|
||||
|
||||
- name: Build deb packages
|
||||
run: make deb-all VERSION=${{ steps.ver.outputs.version }}
|
||||
|
||||
- name: Generate checksums
|
||||
working-directory: dist
|
||||
run: sha256sum *.deb > SHA256SUMS
|
||||
|
||||
- name: List artifacts
|
||||
run: ls -lh dist/
|
||||
|
||||
- name: Upload deb packages to release
|
||||
uses: akkuman/gitea-release-action@v1
|
||||
with:
|
||||
files: |
|
||||
dist/*.deb
|
||||
dist/SHA256SUMS
|
||||
Reference in New Issue
Block a user