Add job to build packages on-demand

This commit is contained in:
Frédéric Guillot 2024-02-21 20:25:01 -08:00
parent facf38955c
commit 856b96cbf8
3 changed files with 49 additions and 2 deletions

View file

@ -16,6 +16,8 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Compile binaries - name: Compile binaries
env:
CGO_ENABLED: 0
run: make build run: make build
- name: Upload binaries - name: Upload binaries
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4

View file

@ -1,6 +1,7 @@
name: Debian Packages name: Debian Packages
permissions: read-all permissions: read-all
on: on:
workflow_dispatch:
push: push:
tags: tags:
- '[0-9]+.[0-9]+.[0-9]+' - '[0-9]+.[0-9]+.[0-9]+'
@ -28,8 +29,34 @@ jobs:
run: make debian-packages run: make debian-packages
- name: List generated files - name: List generated files
run: ls -l *.deb run: ls -l *.deb
build-packages-manually:
if: github.event.workflow_dispatch
name: Build Packages Manually
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
id: buildx
with:
install: true
- name: Available Docker Platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Build Debian Packages
run: make debian-packages
- name: Upload package
uses: actions/upload-artifact@v4
with:
name: packages
path: "*.deb"
if-no-files-found: error
retention-days: 3
publish-packages: publish-packages:
if: ${{ ! github.event.pull_request }} if: github.event.push
name: Publish Packages name: Publish Packages
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:

View file

@ -1,6 +1,7 @@
name: RPM Packages name: RPM Packages
permissions: read-all permissions: read-all
on: on:
workflow_dispatch:
push: push:
tags: tags:
- '[0-9]+.[0-9]+.[0-9]+' - '[0-9]+.[0-9]+.[0-9]+'
@ -19,8 +20,25 @@ jobs:
run: make rpm run: make rpm
- name: List generated files - name: List generated files
run: ls -l *.rpm run: ls -l *.rpm
build-package-manually:
if: github.event.workflow_dispatch
name: Build Packages Manually
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build RPM Package
run: make rpm
- name: Upload package
uses: actions/upload-artifact@v4
with:
name: packages
path: "*.rpm"
if-no-files-found: error
retention-days: 3
publish-package: publish-package:
if: ${{ ! github.event.pull_request }} if: github.event.push
name: Publish Packages name: Publish Packages
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps: