83 lines
2.6 KiB
YAML
Raw Normal View History

2025-02-08 22:41:57 +01:00
name: Build and publish RaspAP images
2024-10-31 14:43:34 +05:30
permissions:
contents: write
on:
2025-02-08 11:37:25 +01:00
workflow_dispatch:
2024-10-31 14:43:34 +05:30
release:
types: [published]
jobs:
build-raspap-image:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- arch: "32-bit"
pi_gen_version: "master"
- arch: "64-bit"
pi_gen_version: "arm64"
fail-fast: false
2024-10-31 14:43:34 +05:30
steps:
- name: Checkout repository
uses: actions/checkout@v4
2024-11-04 22:05:02 +05:30
- name: Add RaspAP Stage
2024-10-31 18:20:25 +05:30
run: |
2024-11-04 22:05:02 +05:30
mkdir -p stage-raspap/package-raspap &&
2024-10-31 18:20:25 +05:30
{
2024-11-04 22:05:02 +05:30
cat > stage-raspap/package-raspap/00-run-chroot.sh <<-EOF
2024-10-31 18:20:25 +05:30
#!/bin/bash
apt-get update -y && apt-get install -y curl dhcpcd5 procps
2025-02-24 08:23:20 +01:00
curl -sL https://install.raspap.com | bash -s -- --yes --openvpn 1 --restapi 1 --adblock 1 --wireguard 1 --tcp-bbr 1 --check 0
# Set Wi-Fi country to prevent RF kill
raspi-config nonint do_wifi_country "US"
2025-02-12 08:34:42 +01:00
# Fetch RaspAP version and set MOTD
RASPAP_VERSION=\$(curl -sL https://install.raspap.com | bash -s -- --version)
echo "\$RASPAP_VERSION" | tee /etc/motd
EOF
} &&
chmod +x stage-raspap/package-raspap/00-run-chroot.sh &&
{
cat > stage-raspap/prerun.sh <<-EOF
#!/bin/bash -e
if [ ! -d "\${ROOTFS_DIR}" ]; then
copy_previous
fi
2024-10-31 18:20:25 +05:30
EOF
} &&
2024-11-04 22:05:02 +05:30
chmod +x stage-raspap/package-raspap/00-run-chroot.sh &&
2024-10-31 18:20:25 +05:30
{
2024-11-04 22:05:02 +05:30
cat > stage-raspap/prerun.sh <<-EOF
2024-10-31 18:20:25 +05:30
#!/bin/bash -e
if [ ! -d "\${ROOTFS_DIR}" ]; then
copy_previous
fi
EOF
} &&
2024-11-04 22:05:02 +05:30
chmod +x stage-raspap/prerun.sh
2024-10-31 18:20:25 +05:30
2024-10-31 14:43:34 +05:30
- name: Build RaspAP Image
id: build
uses: usimd/pi-gen-action@v1
with:
image-name: "raspap-bookworm-${{ matrix.arch == '32-bit' && 'armhf' || 'arm64' }}-lite-${{ github.event.inputs.tag || github.ref_name }}"
2024-10-31 14:43:34 +05:30
enable-ssh: 1
2024-11-04 22:05:02 +05:30
stage-list: stage0 stage1 stage2 ./stage-raspap
2024-10-31 14:43:34 +05:30
verbose-output: true
pi-gen-version: ${{ matrix.pi_gen_version }}
2025-02-27 13:41:33 -08:00
pi-gen-repository: billz/pi-gen
2024-10-31 14:43:34 +05:30
- name: Upload Artifact
uses: svenstaro/upload-release-action@v2
with:
asset_name: "raspap-bookworm-${{ matrix.arch == '32-bit' && 'armhf' || 'arm64' }}-lite-${{ github.event.inputs.tag || github.ref_name }}.img.zip"
file: ${{ steps.build.outputs.image-path }}
2024-10-31 14:43:34 +05:30
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.event.inputs.tag || github.ref }}
2024-10-31 14:43:34 +05:30
overwrite: true