-
Notifications
You must be signed in to change notification settings - Fork 2
217 lines (183 loc) · 8.96 KB
/
docker.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
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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
---
name: Slackware Docker Images
on:
workflow_dispatch:
schedule:
- cron: 0 3 * * *
push:
branches:
- master
pull_request:
branches:
- master
concurrency:
group: docker-${{ github.head_ref || github.ref_name }}
cancel-in-progress: false
env:
# renovate: datasource=docker depName=alpine versioning=docker
ALPINE_IMAGE: alpine:3.21.2@sha256:56fa17d2a7e7f168a043a2712e63aed1f8543aeafdcee47c58dcffe38ed51099
ARMEDSLACK_VERSIONS: '["12.2","13.1","13.37"]'
SLACKWAREARM_VERSIONS: '["14.0","14.1","14.2","15.0"]'
SLACKWAREAARCH64_VERSIONS: '["current"]'
PRE_SLACKWARE64_VERSIONS: '["8.1","9.0","9.1","10.0","10.1","10.2","11.0","12.0","12.1","12.2"]'
LATEST_VERSION: '15.0'
REGISTRY_IMAGE: ${{ github.repository_owner }}/slackware
jobs:
docker:
strategy:
matrix:
version: ['8.1', '9.0', '9.1', '10.0', '10.1', '10.2', '11.0', '12.0', '12.1', '12.2', '13.0', '13.1', '13.37', '14.0', '14.1', '14.2', '15.0',
current]
runs-on: ubuntu-24.04
permissions:
packages: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
show-progress: false
- name: Prep downloads
run: |
mkdir -p changelogs
- name: Fetch slackware ChangeLog
run: |
curl -s -f -o changelogs/ChangeLog.txt.386 https://slackware.osuosl.org/slackware-${{ matrix.version }}/ChangeLog.txt
- name: Fetch slackware64 ChangeLog
if: false == contains(fromJson(env.PRE_SLACKWARE64_VERSIONS), matrix.version)
run: |
curl -s -f -o changelogs/ChangeLog.txt.amd64 https://slackware.osuosl.org/slackware64-${{ matrix.version }}/ChangeLog.txt
- name: Fetch armedslack ChangeLog
if: contains(fromJson(env.ARMEDSLACK_VERSIONS), matrix.version)
run: |
curl -s -f -o changelogs/ChangeLog.txt.arm https://slackware.uk/slackwarearm/armedslack-${{ matrix.version }}/ChangeLog.txt
- name: Fetch slackwarearm ChangeLog
if: contains(fromJson(env.SLACKWAREARM_VERSIONS), matrix.version)
run: |
curl -s -f -o changelogs/ChangeLog.txt.arm https://slackware.uk/slackwarearm/slackwarearm-${{ matrix.version }}/ChangeLog.txt
- name: Fetch slackwareaarch64 ChangeLog
if: contains(fromJson(env.SLACKWAREAARCH64_VERSIONS), matrix.version)
run: |
curl -s -f -o changelogs/ChangeLog.txt.arm https://slackware.uk/slackwarearm/slackwareaarch64-${{ matrix.version }}/ChangeLog.txt
- name: Cache Base Tarballs
id: cache-base-tarballs
if: github.event_name != 'pull_request'
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: base_tarballs/
key: ${{ runner.os }}-base-tarballs-${{ matrix.version }}-${{ hashFiles('**/changelogs/ChangeLog*', '**/scripts/build_base_image.sh') }}
- name: Set up QEMU
uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a # v3.3.0
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build slackware tarball
if: github.event_name == 'pull_request' || steps.cache-base-tarballs.outputs.cache-hit != 'true'
run: |
docker run --privileged --security-opt apparmor:unconfined --rm \
-e RELEASENAME="slackware" -e ARCH="i586" -e VERSION=${{ matrix.version }} -e CHOWN_TO="$(id -u):$(id -g)" \
-v "$(pwd):/data" -v "$(pwd)/scripts:/scripts" ${{ env.ALPINE_IMAGE }} \
sh /scripts/build_base_image.sh
cp slackware-${{ matrix.version }}.tar base_tarballs/
- name: Build slackware64 tarball
if: (github.event_name == 'pull_request' || steps.cache-base-tarballs.outputs.cache-hit != 'true') && false == contains(fromJson(env.PRE_SLACKWARE64_VERSIONS),
matrix.version)
run: |
docker run --privileged --security-opt apparmor:unconfined --rm \
-e RELEASENAME="slackware64" -e ARCH="x86_64" -e VERSION=${{ matrix.version }} -e CHOWN_TO="$(id -u):$(id -g)" \
-v "$(pwd):/data" -v "$(pwd)/scripts:/scripts" ${{ env.ALPINE_IMAGE }} \
sh /scripts/build_base_image.sh
cp slackware64-${{ matrix.version }}.tar base_tarballs/
- name: Build armedslack tarball
if: (github.event_name == 'pull_request' || steps.cache-base-tarballs.outputs.cache-hit != 'true') && contains(fromJson(env.ARMEDSLACK_VERSIONS),
matrix.version)
run: |
CHECKSUMS="yes"
if [ "${{ matrix.version }}" = "13.1" ] ; then
CHECKSUMS="yes-no-checksums-gpg"
fi
docker run --privileged --security-opt apparmor:unconfined --rm \
-e CHECKSUMS="$CHECKSUMS" \
-e RELEASENAME="armedslack" -e ARCH="arm" -e VERSION=${{ matrix.version }} -e CHOWN_TO="$(id -u):$(id -g)" \
-v "$(pwd):/data" -v "$(pwd)/scripts:/scripts" ${{ env.ALPINE_IMAGE }} \
sh /scripts/build_base_image.sh
mv armedslack-${{ matrix.version }}.tar slackwarearm-${{ matrix.version }}.tar
cp slackwarearm-${{ matrix.version }}.tar base_tarballs/
- name: Build slackwarearm tarball
if: (github.event_name == 'pull_request' || steps.cache-base-tarballs.outputs.cache-hit != 'true') && contains(fromJson(env.SLACKWAREARM_VERSIONS),
matrix.version)
run: |
CHECKSUMS="yes"
if [ "${{ matrix.version }}" = "14.1" ] ; then
CHECKSUMS="yes-no-checksums-gpg"
fi
docker run --privileged --security-opt apparmor:unconfined --rm \
-e CHECKSUMS="$CHECKSUMS" \
-e RELEASENAME="slackwarearm" -e ARCH="arm" -e VERSION=${{ matrix.version }} -e CHOWN_TO="$(id -u):$(id -g)" \
-v "$(pwd):/data" -v "$(pwd)/scripts:/scripts" ${{ env.ALPINE_IMAGE }} \
./scripts/build_base_image.sh
cp slackwarearm-${{ matrix.version }}.tar base_tarballs/
- name: Build slackwareaarch64 tarball
if: (github.event_name == 'pull_request' || steps.cache-base-tarballs.outputs.cache-hit != 'true') && contains(fromJson(env.SLACKWAREAARCH64_VERSIONS),
matrix.version)
run: |
docker run --privileged --security-opt apparmor:unconfined --rm \
-e RELEASENAME="slackwareaarch64" -e ARCH="aarch64" -e VERSION=${{ matrix.version }} -e CHOWN_TO="$(id -u):$(id -g)" \
-v "$(pwd):/data" -v "$(pwd)/scripts:/scripts" ${{ env.ALPINE_IMAGE }} \
sh /scripts/build_base_image.sh
cp slackwareaarch64-${{ matrix.version }}.tar base_tarballs/
- name: Restore prerequisites
if: github.event_name != 'pull_request' && steps.cache-base-tarballs.outputs.cache-hit == 'true'
run: |
cp base_tarballs/*tar .
- name: Compute docker platforms
run: |
VERSION="${{ matrix.version }}" ./.github/workflows/bin/configure_docker_platforms.sh
- name: Docker meta
id: meta
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1
with:
images: |
${{ env.REGISTRY_IMAGE }}
ghcr.io/${{ env.REGISTRY_IMAGE }}
tags: |
type=raw,value=${{ matrix.version }}
type=raw,value=latest,enable=${{ matrix.version == env.LATEST_VERSION }}
- name: Build and push
if: github.event_name != 'pull_request' && steps.cache-base-tarballs.outputs.cache-hit != 'true'
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6.13.0
with:
push: true
platforms: ${{ env.docker_platforms }}
cache-from: type=gha
cache-to: type=gha,mode=max
context: .
file: Dockerfile
build-args: |
VERSION=${{ matrix.version }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
- name: Build and test docker
if: github.event_name == 'pull_request'
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6.13.0
with:
push: false
load: false
platforms: ${{ env.docker_platforms }}
context: .
file: Dockerfile
build-args: |
VERSION=${{ matrix.version }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}