Skip to content

iso_build

iso_build #59

Workflow file for this run

name: iso_build
on:
workflow_dispatch:
# schedule:
# - cron: '30 2 * * *'
jobs:
prepare-release:
runs-on: ubuntu-latest
steps:
-
uses: styfle/cancel-workflow-action@0.9.0
with:
access_token: ${{ github.token }}
-
id: time
uses: nanzm/get-time-action@v1.1
with:
format: 'DDMMYYYYHHmm'
outputs:
release_tag: ${{ steps.time.outputs.time }}
build-release:
runs-on: ubuntu-latest
needs: [prepare-release]
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 512
swap-size-mb: 1024
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
- name: Allow workflow to be cancelled
uses: styfle/cancel-workflow-action@0.9.0
with:
access_token: ${{ github.token }}
- name: Build
container:

Check failure on line 40 in .github/workflows/buildISO.yml

View workflow run for this annotation

GitHub Actions / iso_build

Invalid workflow file

The workflow is not valid. .github/workflows/buildISO.yml (Line: 40, Col: 9): Unexpected value 'container'
image: archlinux:latest
options: --privileged
id: build
run: |
# Check free space
df -h
# Update pacman
pacman-key --init
pacman-key --populate
# Enable multilib
echo "[multilib]" >> /etc/pacman.conf
echo "Include = /etc/pacman.d/mirrorlist" >> /etc/pacman.conf
# Chaotic-AUR
pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com
pacman-key --lsign-key 3056513887B78AEB
pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst' --noconfirm
echo "[chaotic-aur]" >> /etc/pacman.conf
echo "Include = /etc/pacman.d/chaotic-mirrorlist" >> /etc/pacman.conf
# Set timezone
ln -sf /usr/share/zoneinfo/Europe/Athens /etc/localtime
# Set locale
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
# Set BUILD_DATE
export BUILD_DATE=$(date +'%d-%m-%Y')
# Make sure container is up-to-date
pacman -Syu --noconfirm
# Install necessary packages
pacman -S git github-cli go archiso pacman-contrib binutils make gcc pkg-config fakeroot sudo zip base-devel rustup --needed --noconfirm
# Create a builder user so makepkg doesn't run as root
sudo useradd builder -m
# Allow the builder user to run sudo without a password
echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
# Become the builder
cd /home/builder
sudo -u builder bash << EOF
# Set up rust
rustup install stable
rustup default stable
# Paru (AUR helper)
git clone https://aur.archlinux.org/paru.git
cd paru
makepkg -si --noconfirm
cd ..
paru -Sy rate-mirrors-bin --noconfirm
# Find fastest mirrors
rate-mirrors --allow-root arch | sudo tee /etc/pacman.d/mirrorlist; paru -Syyu --noconfirm
# Clone ISO repo and enter it
mkdir build
cd build
git init
git remote add -f origin https://github.com/evangelospro/dotfiles
git config core.sparseCheckout true
echo "iso" >> .git/info/sparse-checkout
git config --global init.defaultBranch main
git pull origin main
ls -lasih
cd iso
ls -lasih . # check if iso folder is there
# Build ISO and rename to match BUILD_DATE
bash aur.sh enable
bash build-no-cache.sh
# Stop being the builder
exit
EOF
cd isoOUT
ISO_PATH=$(find . -type f -name "*.iso")
ISO_NAME=$(basename $ISO_PATH)
ISO_PKGS=$(find . -type f -name "*.txt")
# split the iso if larger than 2GB
split -b 1950M $ISO_PATH "${ISO_NAME%.*}.part"
\ls -lasih .
for part in $(\ls *.part*); do
sha256sum $part > "${part}.sha256"
done
\ls -lasih .
- name: Upload Releases
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
*.part*
*.sha256
*.txt
-
name: Rollback
if: ${{ failure() || cancelled() }}
run: |
echo ${{ github.token }} | gh auth login --with-token
gh release delete ${{ needs.prepare-release.outputs.release_tag }} -y --repo ${{ github.repository }}