-
Notifications
You must be signed in to change notification settings - Fork 0
195 lines (167 loc) · 5.98 KB
/
debian.yml
File metadata and controls
195 lines (167 loc) · 5.98 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
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
name: Debian Packages
on: [push]
jobs:
debian-build:
strategy:
fail-fast: false
matrix:
include:
- runner: ubuntu-24.04
arch: amd64
- runner: ubuntu-24.04-arm
arch: arm64
# - runner: ubuntu-24.04-riscv
# arch: riscv64
runs-on: ${{ matrix.runner }}
name: Debian Build
permissions:
packages: write
contents: read
steps:
- name: Checkout source code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: recursive
- name: Setup up Docker Buildx
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
- name: Make builder container image
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
with:
context: debian
file: debian/Dockerfile
platforms: linux/${{ matrix.arch }}
tags: cartesi/deb-builder-${{ matrix.arch }}
load: true
push: false
cache-from: type=gha,scope=${{ matrix.arch }}
cache-to: type=gha,scope=${{ matrix.arch }},mode=max
- name: Restore cached packages
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: cdn/apt
key: apt-packages-${{ matrix.arch }}-${{ github.sha }}
restore-keys: apt-packages-${{ matrix.arch }}-
- name: Build packages
working-directory: debian
run: make packages TARGET_ARCH=${{ matrix.arch }}
- name: Export builder container image
run: docker save cartesi/deb-builder-${{ matrix.arch }} | gzip > /tmp/deb-builder-${{ matrix.arch }}.tar.gz
- name: Upload builder container image
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: image-deb-builder-${{ matrix.arch }}
path: /tmp/deb-builder-${{ matrix.arch }}.tar.gz
- name: Upload artifacts
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: artifacts-apt-${{ matrix.arch }}
path: cdn/apt
debian-test:
runs-on: ubuntu-24.04
name: Debian Test
needs: [ debian-build ]
permissions:
packages: write
contents: read
steps:
- name: Checkout source code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: recursive
- name: Download apt artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: artifacts-apt-*
path: cdn/apt/
merge-multiple: true
- name: Download builder images
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: image-deb-builder-*
path: /tmp/images
- name: Set up QEMU
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
- name: Import builder images
run: find /tmp/images -name '*.tar.gz' | xargs -I {} docker image load --input {}
- name: Make index
working-directory: debian
run: make index
- name: Test
working-directory: debian
run: |
make test-packages TARGET_ARCH=amd64
make test-packages TARGET_ARCH=arm64
debian-sign:
runs-on: ubuntu-24.04
name: Debian Signing
needs: [ debian-build, debian-test ]
#FIXME: uncoment when have final signing key
#if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
#environment: signing
steps:
- name: Checkout source code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: recursive
- name: Download apt artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: artifacts-apt-*
path: cdn/apt/
merge-multiple: true
- name: Download builder images
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: image-deb-builder-amd64
path: /tmp/images
- name: Import builder images
run: find /tmp/images -name '*.tar.gz' | xargs -I {} docker image load --input {}
- name: Import GPG signing key
working-directory: debian
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
run: |
mkdir -p key
chmod 700 key
echo "$GPG_PRIVATE_KEY" | base64 -d | gpg --homedir "$(pwd)/key" --import
- name: Make index
working-directory: debian
run: make index
- name: Sign repository
working-directory: debian
run: make sign
- name: Upload artifacts
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: signed-artifacts-apt
path: cdn/apt
publish:
needs: debian-sign
#FIXME: uncoment when process is validated
#if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- name: Checkout gh-pages
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: gh-pages
- name: Download signed archives
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: signed-artifacts-apt
path: incoming/
- name: Update site
run: |
ls -R .
# cp -vf incoming/stable/* apt/stable/*
exit 1
- name: Push to gh-pages
run: |
cd site
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -A
git diff --staged --quiet || git commit -m "Publish ${{ github.ref_name }}"
git push