2024-03-13 18:41:38 +01:00
|
|
|
---
|
|
|
|
name: Build and publish Debian package
|
|
|
|
on: [create]
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: docker
|
|
|
|
container:
|
|
|
|
image: docker.io/brenard/debian-python-deb:latest
|
|
|
|
steps:
|
|
|
|
- name: Check out repository code
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
- name: Build Debian package
|
|
|
|
env:
|
|
|
|
MAINTAINER_NAME: ${{ vars.MAINTAINER_NAME }}
|
|
|
|
MAINTAINER_EMAIL: ${{ vars.MAINTAINER_EMAIL }}
|
|
|
|
DEBIAN_CODENAME: ${{ vars.DEBIAN_CODENAME }}
|
|
|
|
run: |
|
2024-07-15 17:07:55 +02:00
|
|
|
echo "${{ secrets.GPG_KEY }}" | base64 -d | gpg --import
|
2024-03-13 18:41:38 +01:00
|
|
|
./build.sh
|
|
|
|
- name: Upload Debian package files
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: dist
|
|
|
|
path: |
|
2024-07-15 17:07:55 +02:00
|
|
|
dist
|
2024-03-13 18:41:38 +01:00
|
|
|
|
|
|
|
publish-forgejo:
|
|
|
|
runs-on: docker
|
|
|
|
container:
|
|
|
|
image: docker.io/brenard/debian-python-deb:latest
|
2024-07-15 17:07:55 +02:00
|
|
|
needs:
|
|
|
|
- build
|
2024-03-13 18:41:38 +01:00
|
|
|
steps:
|
|
|
|
- name: Download Debian package files
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: dist
|
|
|
|
|
|
|
|
- name: Create the release
|
|
|
|
id: create-release
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
mkdir release
|
|
|
|
mv *.deb release/
|
2024-07-15 17:07:55 +02:00
|
|
|
mv check-*/check_* release/
|
2024-03-13 18:41:38 +01:00
|
|
|
md5sum release/* > md5sum.txt
|
|
|
|
sha512sum release/* > sha512sum.txt
|
|
|
|
mv md5sum.txt sha512sum.txt release/
|
|
|
|
{
|
|
|
|
echo 'release_note<<EOF'
|
2024-07-15 17:07:55 +02:00
|
|
|
cat release_notes.md | sed 's/"/\\"/g'
|
2024-03-13 18:41:38 +01:00
|
|
|
echo 'EOF'
|
|
|
|
} >> "$GITHUB_OUTPUT"
|
|
|
|
|
|
|
|
- name: Publish release on Forgejo
|
2024-07-15 17:07:55 +02:00
|
|
|
uses: actions/forgejo-release@v2
|
2024-03-13 18:41:38 +01:00
|
|
|
with:
|
|
|
|
direction: upload
|
|
|
|
url: https://gitea.zionetrix.net
|
|
|
|
token: ${{ secrets.forgejo_token }}
|
|
|
|
release-dir: release
|
|
|
|
release-notes: ${{ steps.create-release.outputs.release_note }}
|
|
|
|
|
|
|
|
publish-aptly:
|
|
|
|
runs-on: docker
|
|
|
|
container:
|
|
|
|
image: docker.io/brenard/aptly-publish:latest
|
2024-07-15 17:07:55 +02:00
|
|
|
needs:
|
|
|
|
- build
|
2024-03-13 18:41:38 +01:00
|
|
|
steps:
|
|
|
|
- name: "Download Debian package files"
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: dist
|
|
|
|
|
|
|
|
- name: "Publish Debian package on Aptly repository"
|
|
|
|
uses: https://gitea.zionetrix.net/bn8/aptly-publish@master
|
|
|
|
with:
|
|
|
|
api_url: ${{ vars.apt_api_url }}
|
|
|
|
api_username: ${{ vars.apt_api_username }}
|
|
|
|
api_password: ${{ secrets.apt_api_password }}
|
|
|
|
repo_name: ${{ vars.apt_repo_name }}
|
|
|
|
path: "./"
|
|
|
|
source_name: ${{ vars.apt_source_name }}
|