-
Notifications
You must be signed in to change notification settings - Fork 17
86 lines (76 loc) · 2.3 KB
/
ci-deb.yml
File metadata and controls
86 lines (76 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
on:
push:
branches:
- master
tags:
- v?[0-9]+.[0-9]+.[0-9]+*
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
discover:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
outputs:
matrix: ${{ steps.discover.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/flakehub-cache-action@main
- id: discover
run: |
flake_json=$(nix flake show --all-systems --json 2>/dev/null)
matrix=$(echo "$flake_json" | jq -c '[.inventory.packages.output.children
| to_entries[]
| .key as $sys
| .value.children
| keys[]
| select(endswith("-deb"))
| {system: $sys, package: .}]')
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
build:
needs: discover
runs-on: ${{ matrix.system == 'aarch64-linux' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
permissions:
id-token: write
contents: read
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.discover.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/flakehub-cache-action@main
- name: Build .deb package
run: nix build '.#packages.${{ matrix.system }}.${{ matrix.package }}' -o result
- name: Determine .deb filename
id: meta
run: |
deb=$(basename "$(readlink result)")
cp result "$deb"
echo "filename=$deb" >> "$GITHUB_OUTPUT"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.package }}-${{ matrix.system }}
path: ${{ steps.meta.outputs.filename }}
release:
if: startsWith(github.ref, 'refs/tags/v')
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: debs
merge-multiple: true
- name: Upload to release
uses: softprops/action-gh-release@v2
with:
files: debs/*.deb