diff --git a/.github/workflows/build-check.yaml b/.github/workflows/build-check.yaml index c1c9f256e..96385867f 100644 --- a/.github/workflows/build-check.yaml +++ b/.github/workflows/build-check.yaml @@ -29,16 +29,9 @@ jobs: mkarchiso -v -w workdir/ -o out/ . " - - name: Rename ISO to Arch.iso - run: | - docker exec arch-container bash -c " - iso_file=\$(ls /workdir/out/*.iso 2>/dev/null | head -n 1) && - [ -n \"\$iso_file\" ] && mv \$iso_file /workdir/out/Arch.iso || echo 'No ISO file found.' - " - - name: Copy ISO to Host run: | - docker cp arch-container:/workdir/out/Arch.iso ${{ github.workspace }}/ || echo 'Failed to copy ISO to host.' + docker cp arch-container:/workdir/out/Arch.iso ${{ github.workspace }}/ - name: Get current date id: date @@ -90,5 +83,5 @@ jobs: - name: Clean Up run: | - docker stop arch-container || echo 'Failed to stop the container.' - docker rm arch-container || echo 'Failed to remove the container.' + docker stop arch-container + docker rm arch-container diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index da0d8191a..85e3a1a57 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -8,48 +8,32 @@ on: jobs: build: runs-on: ubuntu-latest # Use a standard runner + container: + image: archlinux:latest steps: - name: Checkout Repository uses: actions/checkout@v4 - - name: Set up Arch Linux Container + - name: Update Arch Linux and install dependencies run: | - docker run --privileged --name arch-container -d -v ${{ github.workspace }}:/workdir archlinux:latest sleep infinity + pacman -Syu --noconfirm && + pacman -S --noconfirm git archiso grub - - name: Build ISO in Arch Container + - name: Build ISO run: | - set -e - docker exec arch-container bash -c " - pacman -Syu --noconfirm && - pacman -S --noconfirm git archiso grub && - cd /workdir && - mkarchiso -v -w workdir/ -o out/ . - " + mkarchiso -v -w workdir/ -o out/ . - - name: Rename ISO to Arch.iso + - name: Rename ISO run: | - set -e - docker exec arch-container bash -c " - iso_file=\$(ls /workdir/out/*.iso 2>/dev/null | head -n 1) && - [ -n \"\$iso_file\" ] && mv \$iso_file /workdir/out/Arch.iso || echo 'No ISO file found.' - " - - - name: List ISO files - run: | - docker exec arch-container bash -c "ls -l /workdir/out/" || echo 'Failed to list files.' - - - name: Copy ISO to Host - run: | - docker cp arch-container:/workdir/out/Arch.iso ${{ github.workspace }}/ || echo 'Failed to copy ISO to host.' + mv out/*.iso out/Arch.iso - name: Get current date id: date run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT - # Create a release on GitHub using GITHUB_TOKEN - name: Create GitHub Release - id: create_release # Adding an ID to reference the release step + id: create_release uses: actions/create-release@v1.1.4 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -61,18 +45,12 @@ jobs: draft: false prerelease: false - # Upload the ISO to the GitHub release with a specific, predictable name - name: Upload ISO to GitHub Release uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ github.workspace }}/Arch.iso + asset_path: out/Arch.iso asset_name: Arch.iso asset_content_type: application/octet-stream - - - name: Clean Up - run: | - docker stop arch-container || echo 'Failed to stop the container.' - docker rm arch-container || echo 'Failed to remove the container.' diff --git a/.github/workflows/dockerfile-check.yaml b/.github/workflows/dockerfile-check.yaml index ed690462d..443aa2198 100644 --- a/.github/workflows/dockerfile-check.yaml +++ b/.github/workflows/dockerfile-check.yaml @@ -1,23 +1,25 @@ -name: Check to make sure Dockerfile works +name: Check Dockerfile and Build Arch ISO on: pull_request: branches: [ "main" ] workflow_dispatch: schedule: - # Run the workflow on the 1st of every month at midnight - cron: 0 0 * * * jobs: build: - runs-on: ubuntu-latest # Use a standard runner + runs-on: ubuntu-latest steps: - name: Checkout Repository uses: actions/checkout@v4 - - name: Build and Run Docker container + + - name: Build and Run Docker Container run: | - set -e # Exit immediately if a command exits with a non-zero status - docker build -t arch-iso-builder . || { echo "Docker build failed"; exit 1; } - docker run --rm --privileged -v "$(pwd)":/workdir arch-iso-builder bash -c "mkarchiso -v -w workdir/ -o out/ ." || { echo "ISO creation failed"; exit 1; } + docker build -t arch-iso-builder . + docker run --rm --privileged \ + -v "${{ github.workspace }}:/workdir" \ + arch-iso-builder \ + bash -c "mkarchiso -v -w workdir/ -o out/ ." diff --git a/README.md b/README.md index fa1230892..7eb74346f 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,19 @@ - --- # Arch Linux Without the Beeps This repository provides a customized Arch Linux ISO with the system beeps disabled, ideal for users who prefer a quieter environment. -## Features +## Table of Contents +- [Features](#features) +- [How to Build the ISO Locally](#how-to-build-the-iso-locally) + - [Prerequisites](#prerequisites) + - [Steps to Build Locally](#steps-to-build-locally) +- [How to Use GitHub Actions (Automated Workflow)](#how-to-use-github-actions-automated-workflow) + - [How It Works](#how-it-works) + - [GitHub Actions Workflow Overview](#github-actions-workflow-overview) + - [How to Trigger the GitHub Workflow](#how-to-trigger-the-github-workflow) +- [License](#license) - **Silent Mode**: The systemd-boot beep and other annoying beeps are completely disabled. - **Arch Linux Base**: Built on the latest Arch Linux, providing a clean and minimal system. diff --git a/profiledef.sh b/profiledef.sh index ce26e793d..6aee89e26 100644 --- a/profiledef.sh +++ b/profiledef.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # shellcheck disable=SC2034 -iso_name="archlinux" +iso_name="Arch" iso_label="ARCH_$(date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y%m)" iso_publisher="Arch Linux " iso_application="Arch Linux Live/Rescue DVD"