-
Notifications
You must be signed in to change notification settings - Fork 2
113 lines (100 loc) · 4.23 KB
/
debian.yml
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
103
104
105
106
107
108
109
110
111
112
113
name: "Debian"
on:
push:
tags:
- debian-*.*.*
jobs:
build:
strategy:
fail-fast: false
matrix:
release:
[
{ distro: "debian", version: "bookworm" },
{ distro: "debian", version: "trixie" },
]
os:
[
{ arch: "aarch64", builder: "ubicloud-standard-2-arm" },
{ arch: "x86_64", builder: "warp-ubuntu-latest-x64-2x" },
]
runs-on: ${{matrix.os.builder}}
env:
ImageOS: ubuntu22
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup IcePAK
uses: upmaru/icepak@v1
with:
alpine: v3.19
arch: ${{matrix.os.arch}}
- name: Generate Serial
id: generate-serial
run: |
echo "serial=$(date +'%Y%m%d')-$GITHUB_RUN_NUMBER" >> $GITHUB_OUTPUT
- name: Build Image
run: |
sudo apt-get install debootstrap btrfs-progs dosfstools qemu-utils gdisk -y
sudo ~/go/bin/distrobuilder build-dir images/${{matrix.release.distro}}.yml rootfs --cache-dir /tmp/build/cache -o image.serial=${{ steps.generate-serial.outputs.serial }} -o image.architecture=${{matrix.os.arch}} -o image.release=${{matrix.release.version}} -o source.url="http://ftp.us.debian.org/debian"
sudo ~/go/bin/distrobuilder pack-incus images/${{matrix.release.distro}}.yml rootfs --cache-dir /tmp/build/cache -o image.serial=${{ steps.generate-serial.outputs.serial }} -o image.architecture=${{matrix.os.arch}} -o image.release=${{matrix.release.version}} -o source.url="http://ftp.us.debian.org/debian"
sudo ~/go/bin/distrobuilder pack-incus images/${{matrix.release.distro}}.yml rootfs --cache-dir /tmp/build/cache --vm -o image.serial=${{ steps.generate-serial.outputs.serial }} -o image.architecture=${{matrix.os.arch}} -o image.release=${{matrix.release.version}} -o source.url="http://ftp.us.debian.org/debian"
- name: Push
run: |
icepak push --serial ${{ steps.generate-serial.outputs.serial }} --os ${{matrix.release.distro}} --arch ${{matrix.os.arch}} --release ${{matrix.release.version}} --variant default
shell: alpine.sh {0}
env:
POLAR_AUTH_TOKEN: ${{ secrets.POLAR_AUTH_TOKEN }}
POLAR_ENDPOINT: ${{ vars.POLAR_ENDPOINT }}
TESTING_IMAGE_SERVER: ${{ secrets.TESTING_IMAGE_SERVER }}
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{matrix.release.distro}}-${{matrix.os.arch}}-${{matrix.release.version}}-${{github.run_number}}
path: |
${{ github.workspace }}/incus.tar.xz
${{ github.workspace }}/disk.qcow2
${{ github.workspace }}/rootfs.squashfs
retention-days: 5
test:
needs: build
strategy:
max-parallel: 1
fail-fast: false
matrix:
release:
[
{ distro: "debian", version: "bookworm", checks: "ipv4,ipv6" },
{ distro: "debian", version: "trixie", checks: "ipv4,ipv6" },
]
os:
[
{ arch: "aarch64", builder: "ubicloud-standard-2-arm" },
{ arch: "x86_64", builder: "warp-ubuntu-latest-x64-2x" },
]
runs-on: ${{matrix.os.builder}}
env:
ImageOS: ubuntu22
steps:
- uses: actions/download-artifact@v4
with:
name: ${{matrix.release.distro}}-${{matrix.os.arch}}-${{matrix.release.version}}-${{github.run_number}}
- name: Setup IcePAK
uses: upmaru/icepak@v1
with:
alpine: v3.19
arch: ${{matrix.os.arch}}
- name: Generate Serial
id: generate-serial
run: |
echo "serial=$(date +'%Y%m%d')-$GITHUB_RUN_NUMBER" >> $GITHUB_OUTPUT
- name: Test
run: |
icepak validate --serial ${{ steps.generate-serial.outputs.serial }} --os ${{matrix.release.distro}} --arch ${{matrix.os.arch}} --release ${{matrix.release.version}} --variant default --checks ${{matrix.release.checks}}
shell: alpine.sh {0}
env:
POLAR_AUTH_TOKEN: ${{ secrets.POLAR_AUTH_TOKEN }}
POLAR_ENDPOINT: ${{ vars.POLAR_ENDPOINT }}
TESTING_IMAGE_SERVER: ${{ secrets.TESTING_IMAGE_SERVER }}