CI: add debian package build workflow
Run cargo lints / Lint on ${{ matrix.build }} (linux-amd64, ubuntu-latest, stable, x86_64-unknown-linux-gnu) (pull_request) Successful in 9m35s Details
Cargo manifest lints / Lint Cargo manifests on ${{ matrix.build }} (linux-amd64, ubuntu-latest, stable, x86_64-unknown-linux-gnu) (pull_request) Successful in 14m29s Details
Run Tests / Test on ${{ matrix.build }} (linux-amd64, ubuntu-latest, stable, x86_64-unknown-linux-gnu) (pull_request) Successful in 15m40s Details
Build .deb package / Package for debian on ${{ matrix.arch }} (amd64, linux-amd64, linux-amd64, ubuntu-latest, stable, x86_64-unknown-linux-gnu) (push) Successful in 13m18s Details
Build release binary / Build on ${{ matrix.build }} (meli-linux-amd64, linux-amd64, ubuntu-latest, stable, x86_64-unknown-linux-gnu) (push) Successful in 9m27s Details

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
pull/323/head
Manos Pitsidianakis 2023-12-10 19:33:17 +02:00
parent 59c99fdc79
commit 2419f4bd40
Signed by: Manos Pitsidianakis
GPG Key ID: 7729C7707F7E09D0
2 changed files with 71 additions and 0 deletions

View File

@ -0,0 +1,65 @@
# SPDX-License-Identifier: EUPL-1.2
name: Build .deb package
env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
RUSTFLAGS: "-D warnings -W unreachable-pub -W rust-2021-compatibility"
RUSTUP_MAX_RETRIES: 10
RUST_BACKTRACE: short
on:
workflow_dispatch:
push:
tags:
- v*
jobs:
build:
name: Package for debian on ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
build: [linux-amd64, ]
include:
- build: linux-amd64
arch: amd64
os: ubuntu-latest
rust: stable
artifact_name: 'linux-amd64'
target: x86_64-unknown-linux-gnu
steps:
- uses: actions/checkout@v3
- id: os-deps
name: install OS dependencies
run: |
apt-get update
apt-get install -y mandoc debhelper quilt build-essential
- id: rustup-setup
name: Install rustup and toolchains
shell: bash
run: |
if ! command -v rustup &>/dev/null; then
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused --location --silent --show-error --fail "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y
source "${HOME}/.cargo/env"
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
echo "CARGO_HOME=${CARGO_HOME:-$HOME/.cargo}" >> $GITHUB_ENV
rustup toolchain install --profile minimal ${{ matrix.rust }} --target ${{ matrix.target }}
rustup default ${{ matrix.rust }}
fi
- name: Build binary
run: |
VERSION=$(grep -m1 version meli/Cargo.toml | head -n1 | cut -d'"' -f 2 | head -n1)
make deb-dist
mkdir artifacts
echo "VERSION=${VERSION}" >> $GITHUB_ENV
mv ../meli_*.deb artifacts/meli-${VERSION}-${{ matrix.artifact_name }}.deb
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: meli-${{env.VERSION}}-${{ matrix.artifact_name }}.deb
path: artifacts/meli-${{env.VERSION}}-${{ matrix.artifact_name }}.deb
if-no-files-found: error
retention-days: 30

6
debian/rules vendored
View File

@ -10,6 +10,12 @@ export DH_VERBOSE = 1
%:
dh $@ --with quilt
override_dh_auto_configure:
true
override_dh_auto_test:
true
#override_dh_auto_install:
# dh_auto_install -- prefix=/usr