-
Notifications
You must be signed in to change notification settings - Fork 5
102 lines (92 loc) · 3.1 KB
/
deb-build.yaml
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Packaging for Debian and Ubuntu
on:
workflow_dispatch:
release:
types:
- published
env:
DEBIAN_FRONTEND: noninteractive
DEBEMAIL: "[email protected]"
DEBFULLNAME: "Brendon Jones"
jobs:
debian-package:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch:
- amd64
- 386
- arm64
- arm/v7
target:
- { distro: debian, codename: buster }
- { distro: debian, codename: bullseye }
- { distro: debian, codename: bookworm }
- { distro: ubuntu, codename: focal }
- { distro: ubuntu, codename: jammy }
exclude:
- arch: arm64
target: { distro: ubuntu, codename: focal }
- arch: arm/v7
target: { distro: ubuntu, codename: focal }
- arch: 386
target: { distro: ubuntu, codename: focal }
- arch: 386
target: { distro: ubuntu, codename: jammy }
env:
DIRNAME: ${{ matrix.target.distro }}_${{ matrix.target.codename }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up qemu
id: qemu
uses: docker/setup-qemu-action@v1
with:
platforms: all
- name: Build packages
run: |
docker run --rm \
--sysctl net.ipv6.conf.all.disable_ipv6=0 \
-e DEBIAN_FRONTEND \
-e CI \
-e GITHUB_ACTIONS \
-e GITHUB_WORKSPACE \
-e DEBEMAIL \
-e DEBFULLNAME \
-e DIRNAME \
-v "${GITHUB_WORKSPACE}:${GITHUB_WORKSPACE}" \
-w "${GITHUB_WORKSPACE}" \
--platform linux/${{ matrix.arch }} \
${{ matrix.target.distro }}:${{ matrix.target.codename }} \
sh -c "./debpkg-setup.sh && ./debpkg-build.sh && mkdir -p packages/${DIRNAME} && cp ../*.deb packages/${DIRNAME}/"
# for now only run tests on amd64 packages
- name: Run packaging tests
if: ${{ matrix.arch == 'amd64' }}
run: |
docker run --rm \
--sysctl net.ipv6.conf.all.disable_ipv6=0 \
-e DEBIAN_FRONTEND \
-e CI \
-e GITHUB_ACTIONS \
-e GITHUB_WORKSPACE \
-e DIRNAME \
-v "${GITHUB_WORKSPACE}:${GITHUB_WORKSPACE}" \
-w "${GITHUB_WORKSPACE}" \
--platform linux/${{ matrix.arch }} \
${{ matrix.target.distro }}:${{ matrix.target.codename }} \
sh -c "./debpkg-setup.sh && ./debpkg-test.sh"
- name: Store artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target.distro }} ${{ matrix.target.codename }} packages
path: packages/
retention-days: 7
- name: Publish packages to cloudsmith
if: ${{ github.event_name == 'release' }}
uses: wanduow/action-cloudsmith-upload-packages@v1
with:
path: packages/
repo: ${{ secrets.CLOUDSMITH_OWNER }}/amp
username: ${{ secrets.CLOUDSMITH_USERNAME }}
api_key: ${{ secrets.CLOUDSMITH_API_KEY }}