-
Notifications
You must be signed in to change notification settings - Fork 0
146 lines (112 loc) · 3.81 KB
/
Copy pathbuild.yaml
File metadata and controls
146 lines (112 loc) · 3.81 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
name: Build
# on:
# release:
# types: [created]
on:
push:
branches:
- main
permissions:
contents: write
packages: write
env:
VERSION: 1
jobs:
image:
if: true
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v4
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
- name: Build and push
uses: docker/build-push-action@v7
with:
tags: ghcr.io/${{ github.repository }}
push: true
file: ./Containerfile
context: ./
platforms: linux/amd64,linux/arm64
iso:
needs: image
strategy:
matrix:
include:
- arch: x86_64
runner: ubuntu-latest
- arch: aarch64
runner: ubuntu-24.04-arm
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Pull image
run: sudo podman pull ghcr.io/${{ github.repository }}
- name: Build it
run: |
mkdir -p ./dist
tee ./dist/config.toml &>/dev/null << EOF
[customizations.installer.kickstart]
contents = """
graphical
rootpw --lock
"""
[customizations.iso]
volume_id = "KEIFT-OS"
EOF
sudo podman run \
--rm \
--privileged \
-v ./dist/config.toml:/config.toml \
-v ./dist:/output \
-v /var/lib/containers/storage:/var/lib/containers/storage \
quay.io/centos-bootc/bootc-image-builder \
--type anaconda-iso \
--rootfs ext4 \
ghcr.io/${{ github.repository }}
rm -rf ./dist/config.toml
sudo chown -R $USER:$USER ./dist
- name: Prepare for injection
run: |
mkdir -p ./dist/inject
cp -r ./src/etc ./dist/inject/etc
cp -r ./src/usr ./dist/inject/usr
- name: Inject it
run: |
sudo apt install -y xorriso cpio
sudo chown -R root:root ./dist/inject
cd ./dist/inject
sudo sh -c "find ./ -mindepth 1 | cpio -H newc -o > ../product.img"
cd ../../
sudo rm -rf ./dist/inject
sudo xorriso \
-indev ./dist/bootiso/install.iso \
-outdev ./dist/keift-os-${{ env.VERSION }}-${{ matrix.arch }}.iso \
-map ./dist/product.img /images/product.img \
-boot_image any replay
sudo rm -rf ./dist/bootiso ./dist/product.img
sudo chown -R $USER:$USER ./dist
- name: Generate checksum file
run: sha256sum ./dist/keift-os-${{ env.VERSION }}-${{ matrix.arch }}.iso | cut -f1 -d " " > ./dist/keift-os-${{ env.VERSION }}-${{ matrix.arch }}.iso-CHECKSUM
- name: Upload to Cloudflare R2
env:
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
run: |
aws s3 cp \
--endpoint-url https://${{ secrets.R2_ACCOUNT_ID }}.r2.cloudflarestorage.com \
./dist/keift-os-${{ env.VERSION }}-${{ matrix.arch }}.iso \
s3://${{ secrets.R2_BUCKET_NAME }}/keift-os-${{ env.VERSION }}-${{ matrix.arch }}.iso
aws s3 cp \
--endpoint-url https://${{ secrets.R2_ACCOUNT_ID }}.r2.cloudflarestorage.com \
./dist/keift-os-${{ env.VERSION }}-${{ matrix.arch }}.iso-CHECKSUM \
s3://${{ secrets.R2_BUCKET_NAME }}/keift-os-${{ env.VERSION }}-${{ matrix.arch }}.iso-CHECKSUM