2022-07-20 09:21:40 +02:00
|
|
|
---
|
2023-06-27 03:38:22 +02:00
|
|
|
name: "Build Deb Packages"
|
2022-07-20 09:21:40 +02:00
|
|
|
|
2023-04-18 13:35:40 +02:00
|
|
|
"on":
|
2022-07-20 09:21:40 +02:00
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
|
2023-04-27 14:35:24 +02:00
|
|
|
env:
|
|
|
|
SCCACHE_GHA_ENABLED: "true"
|
|
|
|
RUSTC_WRAPPER: "sccache"
|
|
|
|
|
2022-11-13 23:57:05 +01:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
2022-07-20 09:21:40 +02:00
|
|
|
jobs:
|
|
|
|
build-deb-package:
|
2023-01-25 00:45:55 +01:00
|
|
|
name: Build deb packages
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
image:
|
2023-12-27 23:46:47 +01:00
|
|
|
- name: ubuntu
|
|
|
|
version: 22.04
|
|
|
|
- name: debian
|
|
|
|
version: 12
|
2023-09-06 02:25:30 +02:00
|
|
|
fail-fast: false
|
2023-01-25 00:45:55 +01:00
|
|
|
runs-on: ubuntu-latest
|
2023-04-03 13:56:58 +02:00
|
|
|
container:
|
2023-12-27 23:46:47 +01:00
|
|
|
image: "${{ matrix.image.name }}:${{ matrix.image.version }}"
|
2023-01-25 00:45:55 +01:00
|
|
|
env:
|
|
|
|
DEBIAN_FRONTEND: noninteractive
|
2022-07-20 09:21:40 +02:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-09-06 02:25:30 +02:00
|
|
|
uses: actions/checkout@v4
|
2023-06-27 03:38:22 +02:00
|
|
|
- name: install curl
|
2022-07-20 09:21:40 +02:00
|
|
|
run: |
|
2023-06-27 03:38:22 +02:00
|
|
|
apt-get update && apt-get install -y curl
|
2023-04-27 14:35:24 +02:00
|
|
|
- name: Setup sccache
|
|
|
|
uses: mozilla-actions/sccache-action@v0.0.3
|
2023-05-04 10:40:00 +02:00
|
|
|
with:
|
|
|
|
version: "v0.4.2"
|
2023-06-27 03:38:22 +02:00
|
|
|
- name: Install Rust
|
|
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
scripts/install_ubuntu_dependencies.sh
|
|
|
|
- name: Install wasm-pack
|
|
|
|
run: cargo install wasm-pack
|
2023-09-06 02:25:30 +02:00
|
|
|
- name: Build packages (kanidm-unixd)
|
|
|
|
run: make -f platform/debian/Makefile debs/kanidm-unixd
|
2024-01-16 02:30:52 +01:00
|
|
|
- name: Build packages (kanidm)
|
2023-12-29 00:47:20 +01:00
|
|
|
run: make -f platform/debian/Makefile debs/kanidm
|
2023-12-27 23:46:47 +01:00
|
|
|
|
2023-01-25 00:45:55 +01:00
|
|
|
- name: Upload debs
|
2023-12-18 01:56:02 +01:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-01-25 00:45:55 +01:00
|
|
|
with:
|
2023-12-27 23:46:47 +01:00
|
|
|
name: "${{ matrix.image.name }}${{ matrix.image.version }}"
|
2023-01-25 00:45:55 +01:00
|
|
|
path: |
|
|
|
|
target/*.deb
|
|
|
|
upload-to-releases:
|
2023-10-26 03:48:58 +02:00
|
|
|
permissions:
|
|
|
|
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
|
|
|
|
contents: write # allows the action to create a release
|
|
|
|
|
2023-01-25 00:45:55 +01:00
|
|
|
name: Upload to releases
|
|
|
|
needs: build-deb-package
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Download previously built debs
|
2023-12-18 01:56:02 +01:00
|
|
|
uses: actions/download-artifact@v4
|
2023-12-31 01:17:33 +01:00
|
|
|
with:
|
|
|
|
path: debs
|
|
|
|
merge-multiple: true
|
2023-01-25 00:45:55 +01:00
|
|
|
- name: List packages
|
|
|
|
run: |
|
2023-12-27 23:46:47 +01:00
|
|
|
find $(pwd) -name '*.deb'
|
2023-12-31 01:17:33 +01:00
|
|
|
# TODO: This action is old and falling apart and will soon stop working.
|
|
|
|
# Context: https://github.com/marvinpinto/action-automatic-releases/pull/2
|
2022-07-20 09:21:40 +02:00
|
|
|
- uses: "marvinpinto/action-automatic-releases@latest"
|
|
|
|
with:
|
|
|
|
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
2023-10-26 03:48:58 +02:00
|
|
|
automatic_release_tag: "debs"
|
2022-07-20 09:21:40 +02:00
|
|
|
prerelease: true
|
2023-10-26 03:48:58 +02:00
|
|
|
title: ".deb Packages"
|
2023-12-31 01:17:33 +01:00
|
|
|
files: "debs/*.deb"
|
2023-12-29 00:47:20 +01:00
|
|
|
if: ${{ github.ref == 'refs/heads/master' && github.repository == 'kanidm/kanidm' }}
|