Skip to content

Commit d689024

Browse files
authored
Merge pull request #1690 from Dhanus3133/ci/build-images
ci: build 32 bit and 64 bit images
2 parents eb25142 + c1975a7 commit d689024

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

.github/workflows/release.yml

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Build and publish RaspAP images
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
release:
8+
types: [published]
9+
10+
jobs:
11+
build-raspap-image:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
include:
16+
- arch: "32-bit"
17+
pi_gen_version: "master"
18+
- arch: "64-bit"
19+
pi_gen_version: "arm64"
20+
fail-fast: false
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
25+
- name: Add RaspAP Stage
26+
run: |
27+
mkdir -p stage-raspap/package-raspap &&
28+
{
29+
cat > stage-raspap/package-raspap/00-run-chroot.sh <<-EOF
30+
#!/bin/bash
31+
apt-get update -y && apt-get install -y curl dhcpcd5 iptables procps
32+
curl -sL https://install.raspap.com | bash -s -- --yes --openvpn 1 --restapi 1 --adblock 1 --wireguard 1 --tcp-bbr 1
33+
EOF
34+
} &&
35+
chmod +x stage-raspap/package-raspap/00-run-chroot.sh &&
36+
{
37+
cat > stage-raspap/prerun.sh <<-EOF
38+
#!/bin/bash -e
39+
if [ ! -d "\${ROOTFS_DIR}" ]; then
40+
copy_previous
41+
fi
42+
EOF
43+
} &&
44+
chmod +x stage-raspap/prerun.sh
45+
46+
- name: Build RaspAP Image
47+
id: build
48+
uses: usimd/pi-gen-action@v1
49+
with:
50+
image-name: "raspap-${{ github.ref_name }}-${{ matrix.arch }}"
51+
enable-ssh: 1
52+
stage-list: stage0 stage1 stage2 ./stage-raspap
53+
verbose-output: true
54+
pi-gen-version: ${{ matrix.pi_gen_version }}
55+
pi-gen-repository: RaspAP/pi-gen
56+
57+
- name: Upload Artifact
58+
uses: svenstaro/upload-release-action@v2
59+
with:
60+
asset_name: raspap-image-${{ github.ref_name }}-${{ matrix.arch }}.zip
61+
file: ${{ steps.build.outputs.image-path }}
62+
repo_token: ${{ secrets.GITHUB_TOKEN }}
63+
tag: ${{ github.ref }}
64+
overwrite: true

0 commit comments

Comments
 (0)