Files
muscl/.gitea/workflows/publish-deb.yml
h7x4 9408096391
Some checks failed
Build and test / test (push) Has been cancelled
Build and test / docs (push) Has been cancelled
Build and test / check-license (push) Has been cancelled
Build and test / build (push) Has been cancelled
Build and test / check (push) Has been cancelled
.gitea/workflows: build for both trixie and bookworm
2025-12-04 15:05:58 +09:00

130 lines
3.7 KiB
YAML

name: "Publish Debian package"
run-name: "Publish Debian package"
on:
workflow_dispatch:
inputs:
deb_version:
description: "Version to publish"
type: string
deb_revision:
description: "Debian package revision"
type: string
default: "1"
required: true
debian_distribution:
description: "Which distributions of debian to publish for"
type: string
default: trixie,bookworm
required: true
# repository_component
# description: "Which apt repository component to publish for
# type: string
# default: main
# required: true
rust_toolchain:
description: "Whether to build the package with stable rust"
type: choice
options:
- stable
- nightly
- beta
default: stable
# TODO: dynamic matrix builds when...
# https://github.com/go-gitea/gitea/issues/25179
jobs:
build-trixie:
name: "Build and publish for Debian Trixie"
runs-on: debian-trixie
if: contains(github.event.inputs.debian_distribution, 'trixie')
steps:
- uses: actions/checkout@v3
- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ inputs.rust_toolchain }}
override: true
- name: Install cargo-deb
run: cargo install cargo-deb
- name: Build deb package
env:
CREATE_DEB_DEBUG: "1"
run: |
CREATE_DEB_ARGS=(
--deb-revision "${{ inputs.deb_revision }}"
)
if [ "${{ inputs.deb_version }}" != "" ]; then
CREATE_DEB_ARGS+=("--deb-version" "${{ inputs.deb_version }}")
fi
./create-deb.sh "${CREATE_DEB_ARGS[@]}"
- name: Upload deb package artifact
uses: actions/upload-artifact@v3
with:
name: muscl-trixie-deb.zip
path: target/debian/*.deb
if-no-files-found: error
retention-days: 30
# Already compressed
compression: 0
# This is not safely doable without either:
# - tokens scoped to the repository: https://github.com/go-gitea/gitea/issues/25900
# - automatically provisioned tokens: https://github.com/go-gitea/gitea/issues/24635
#
# - name: Publish deb package
# run: |
# curl \
# --user your_username:your_password_or_token \
# --upload-file target/debian/*.deb \
# https://git.pvv.ntnu.no/api/packages/${{ github.repository_owner }}/debian/pool/${{ inputs.debian_distribution }}/${{ inputs.repository_component }}/upload
build-bookworm:
name: "Build and publish for Debian Bookworm"
runs-on: debian-bookworm
if: contains(github.event.inputs.debian_distribution, 'bookworm')
steps:
- uses: actions/checkout@v3
- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ inputs.rust_toolchain }}
override: true
- name: Install cargo-deb
run: cargo install cargo-deb
- name: Build deb package
env:
CREATE_DEB_DEBUG: "1"
run: |
CREATE_DEB_ARGS=(
--deb-revision "${{ inputs.deb_revision }}"
)
if [ "${{ inputs.deb_version }}" != "" ]; then
CREATE_DEB_ARGS+=("--deb-version" "${{ inputs.deb_version }}")
fi
./create-deb.sh "${CREATE_DEB_ARGS[@]}"
- name: Upload deb package artifact
uses: actions/upload-artifact@v3
with:
name: muscl-bookworm-deb.zip
path: target/debian/*.deb
if-no-files-found: error
retention-days: 30
# Already compressed
compression: 0