Skip to content

Build ISO Preview

Build ISO Preview #248

Workflow file for this run

name: Build ISO Preview
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *' # Daily
jobs:
build:
runs-on: ubuntu-latest
container:
image: archlinux:latest
options: --privileged
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Set up environment
run: |
pacman -Syu --noconfirm
pacman -S --noconfirm base-devel git archiso github-cli
- name: Build ISO
run: |
mkarchiso -v -r \
-w work \
-o out \
slashoslive
- name: Generate prerelease tag from ISO name
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
ISO_FILE=$(find out -name "*.iso" -type f | head -n1)
echo "Found ISO file: $ISO_FILE"
NAME=$(basename "$ISO_FILE" .iso)
echo "Extracted name: $NAME"
# Split on first dash
BASE=${NAME#*-}
echo "Base after split: $BASE"
BASE_TAG="v${BASE}-prerelease"
echo "Base tag: $BASE_TAG"
TAG="$BASE_TAG"
COUNTER=0
while gh release view "$TAG" --repo ${{ github.repository }} >/dev/null 2>&1; do
COUNTER=$((COUNTER + 1))
TAG="${BASE_TAG}-${COUNTER}"
echo "Tag exists, incrementing counter. New tag: $TAG"
done
echo "Final tag: $TAG"
echo "ISO_FILE=$ISO_FILE" >> "$GITHUB_ENV"
echo "TAG=$TAG" >> "$GITHUB_ENV"
- name: Create GitHub prerelease
uses: svenstaro/upload-release-action@v2
with:
repo_name: ${{ github.repository }}
tag: ${{ env.TAG }}
body: "SlashOS Desktop ISO prerelease"
prerelease: true
file: ${{ env.ISO_FILE }}