Skip to content

deb packaging

deb packaging #99

Workflow file for this run

name: deb packaging
on:
push:
tags:
- 'debian/*.*.*-*'
- 'test/*'
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
build:
uses: dionysius/gbp-gha/.github/workflows/build.yml@main
secrets:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
with:
# https://github.com/orgs/community/discussions/26671
DEBFULLNAME: dionysius (github-actions)
DEBEMAIL: dragon.dionysius+gha@gmail.com
images: '["ubuntu:latest", "debian:stable", "debian:oldstable"]'
architectures: '["amd64", "arm64", "riscv64"]'
natives: '["amd64"]'
before_build_deps_install: |
# install rustup manually if not available as distribution package (fallback)
# mk-build-deps would install rustup if available
# no need to source the env since cargo/rustup is only run in rules
# rustup or cargo will install upstream referenced toolchain and target automatically once invoked in rules
if [ -z "$(apt-cache madison rustup 2>/dev/null)" ]; then
curl -fsSL https://sh.rustup.rs | sh -s -- -y --default-toolchain none
fi
release:
if: startsWith(github.event.ref, 'refs/tags/debian')
needs: [build]
uses: dionysius/gbp-gha/.github/workflows/release.yml@main
with:
prerelease: true
publish: true
promote:
uses: dionysius/gbp-gha/.github/workflows/promote-release.yml@main
needs: [release]
with:
in_days: 7
release_pattern: '{debian/*.*}.*'
# TODO: remove after year 2026
upload-packagecloud:
if: startsWith(github.event.ref, 'refs/tags/debian')
needs: [build]
runs-on: ubuntu-24.04
steps:
- name: download artifacts
uses: actions/download-artifact@v4
- name: install
run: |
sudo gem install package_cloud
echo "PACKAGECLOUD_TOKEN=${{ secrets.PACKAGECLOUD_TOKEN }}" >> $GITHUB_ENV
- name: upload
run: |
for resultdir in $(ls -d results_*); do
# Extract vendor from folder name: results_ubuntu-latest_amd64 -> ubuntu
vendor=$(echo "$resultdir" | sed 's/^results_\([^-]*\).*/\1/')
dist=$(grep -oP "Distribution: \K\w+" $resultdir/*.changes | head -n1)
find $resultdir -name "*.deb" -not -name "*-dbgsym*" -print | xargs -r package_cloud push dionysius/vaultwarden/$vendor/$dist
find $resultdir -name "*.dsc" -print | xargs -r package_cloud push dionysius/vaultwarden/$vendor/$dist
done