-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (92 loc) · 3.02 KB
/
ci.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
name: ci
on:
pull_request:
branches:
- main
push:
branches:
- main
tags:
- '*'
permissions:
contents: read
packages: write
jobs:
build:
strategy:
fail-fast: false
matrix:
fedora:
- 34-1.2
- 35-1.2
- 36-1.5
- 37-1.7
- 38-1.6
- 39-1.5
- 40_Beta-1.10
env:
MAKE: make FEDORA_VERSION=${{ matrix.fedora }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get Fedora version
run: echo "FEDORA_MAJOR=$(${MAKE} show-fedora-major)" >> ${GITHUB_ENV}
- name: Build builder image
run: ${MAKE} builder
- name: Build updater image
run: ${MAKE} updater
- name: Test updater
working-directory: tests/iso-build
run: |
docker run -i --rm \
-v $(pwd):/work \
tmpfsroot-fedora-updater:${FEDORA_MAJOR}
test -f rpms.lock
cat rpms.lock
- name: Test builder
working-directory: tests/iso-build
run: |
docker run -i --rm \
-v $(pwd)/rpms.lock:/work/rpms.lock:ro \
-v $(pwd)/packages.list:/work/packages.list:ro \
-v $(pwd)/output:/work/output \
-e DISK_DEVS=sda \
-e MAIN_DISK=sda \
-e PARTSIZE_DOCKER=1024 \
-e PARTSIZE_LOG=1024 \
-e PARTSIZE_CACHE=1024 \
-e PARTSIZE_OPT=1024 \
tmpfsroot-fedora-builder:${FEDORA_MAJOR}
test -f output/fedora-custom.iso
ls -lh output/fedora-custom.iso
- name: Login to GitHub Container Registry
if: github.event_name == 'push'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Upload to GitHub Container Registry (latest)
if: github.ref == 'refs/heads/main'
run: |
docker tag \
tmpfsroot-fedora-builder:${FEDORA_MAJOR} \
ghcr.io/seqsense/tmpfsroot-fedora-builder:${FEDORA_MAJOR}
docker tag \
tmpfsroot-fedora-updater:${FEDORA_MAJOR} \
ghcr.io/seqsense/tmpfsroot-fedora-updater:${FEDORA_MAJOR}
docker push ghcr.io/seqsense/tmpfsroot-fedora-builder:${FEDORA_MAJOR}
docker push ghcr.io/seqsense/tmpfsroot-fedora-updater:${FEDORA_MAJOR}
- name: Upload to GitHub Container Registry (tag)
if: startsWith(github.ref, 'refs/tags/')
run: |
tag=${FEDORA_MAJOR}-${GITHUB_REF#refs/tags/}
docker tag \
tmpfsroot-fedora-builder:${FEDORA_MAJOR} \
ghcr.io/seqsense/tmpfsroot-fedora-builder:${tag}
docker tag \
tmpfsroot-fedora-updater:${FEDORA_MAJOR} \
ghcr.io/seqsense/tmpfsroot-fedora-updater:${tag}
docker push ghcr.io/seqsense/tmpfsroot-fedora-builder:${tag}
docker push ghcr.io/seqsense/tmpfsroot-fedora-updater:${tag}