-
Notifications
You must be signed in to change notification settings - Fork 0
141 lines (123 loc) · 3.8 KB
/
25.04-plucky.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: build (25.04, Plucky)
# auto-task.build-time = ?
on:
{
"push": { "paths": [".github/workflows/25.04-plucky.yml"] },
"schedule": [{ "cron": "25 04 */5 * *" }],
}
env:
DEBIAN_FRONTEND: noninteractive
GET_CTR_LOG: debug
ZSTD_LV: 18
ARCHS: ${{ fromJson(vars.PLUCKY_JSON).archs }}
BUILD_CMD: get-ctr --os ${{vars.OS}} --ver ${{fromJson(vars.PLUCKY_JSON).ver}}
jobs:
build:
strategy:
fail-fast: true
matrix: ${{ fromJson(vars.PLUCKY_JSON).matrix }}
# matrix:
# arch:
# - amd64
# - arm64
runs-on: ubuntu-latest
defaults:
run:
shell: zsh --pipefail -fex {0}
steps:
- name: install zsh
shell: sh -e {0}
run: ${{ vars.INSTALL_ZSH }}
- name: preparations
run: |
${{vars.GET_CTR_CMD}}
${{vars.INSTALL_QEMU_AND_DEBOOTSTRAP}}
- name: Login to REG
uses: docker/login-action@v3
with:
registry: ${{vars.REG_URI}}
username: ${{vars.REG_USER}}
password: ${{ secrets.DEB_UUU_TOKEN }}
- name: build & repack rootfs & save cache
continue-on-error: true
id: build_and_save_cache
run: |
extra_args=(
--arch
${{matrix.arch}}
--obtain
--repack
--zstd-level ${{env.ZSTD_LV}}
--save-cache
)
case ${{matrix.arch}} {
(amd64) extra_args+=(
--auto-add-extra-suites
)
}
print -R ${{env.BUILD_CMD}} $extra_args \"\$@\" > run.sh
${{env.BUILD_CMD}} $extra_args
- name: compatibility-mode
if: steps.build_and_save_cache.outcome == 'failure'
run: sh run.sh --compatibility-mode
# --------------------------------------
docker:
needs: build
runs-on: ubuntu-latest
# defaults:
# run:
# shell: zsh -fe {0}
env:
digests_ron: digests.ron
digests_yaml: digests.yml
steps:
- name: Login to REG
uses: docker/login-action@v3
with:
registry: ${{vars.REG_URI}}
username: ${{vars.REG_USER}}
password: ${{ secrets.DEB_UUU_TOKEN }}
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: get `get-ctr` bin from docker
run: ${{vars.GET_CTR_CMD}}
- name: install qemu-user & debootstrap
run: ${{vars.INSTALL_QEMU_AND_DEBOOTSTRAP}}
- name: restore cache
run: |
archs=( ${{env.ARCHS}} )
for arch in "${archs[@]}"; do
${{env.BUILD_CMD}} --restore-cache --arch $arch
tree tmp
done
- name: build container
run: ${{env.BUILD_CMD}} --build
- name: push to ghcr & reg
run: ${{env.BUILD_CMD}} --push
- name: create manifest
run: ${{env.BUILD_CMD}} --create-manifest --update-repo-digest
- name: generate digests.{ron,yml}
run: ${{env.BUILD_CMD}} --digest ${{env.digests_ron}} --digest ${{env.digests_yaml}}
- name: create digests.md
run: |
echo '```yaml' > digests.md
cat tmp/${{env.digests_yaml}} >> digests.md
echo '```' >> digests.md
echo TITLE=$(${{env.BUILD_CMD}} --title) >>$GITHUB_ENV
- name: +RELEASE_TAG env
run: echo RELEASE_TAG=$(${{env.BUILD_CMD}} --release-tag) >>$GITHUB_ENV
- name: release
uses: softprops/action-gh-release@v2
with:
fail_on_unmatched_files: true
tag_name: ${{env.RELEASE_TAG}}
name: ${{env.TITLE}}
files: |
tmp/zstd/*.zst
tmp/${{env.digests_ron}}
tmp/${{env.digests_yaml}}
body_path: digests.md