Skip to content

Commit

Permalink
Rewrite build script and use build container
Browse files Browse the repository at this point in the history
  • Loading branch information
sharpenedblade committed Oct 1, 2023
1 parent e6ad815 commit d4852c9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 26 deletions.
29 changes: 16 additions & 13 deletions .github/workflows/build-iso.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,40 @@ jobs:
runs-on: ubuntu-latest
steps:

- name: "Increase Disk Space"
- name: Increase Disk Space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo docker image prune --all --force
sudo rm -rf /home/linuxbrew
sudo apt-get remove -y --purge fonts-noto-color-emoji subversion \
sshpass g++ gcc gnupg2 imagemagick jq libmagic-dev \
libmagickcore-dev libmagickwand-dev libssl-dev \
mercurial openssh-client p7zip-full ftp bison
sudo apt-get autoremove -y
- name: Checkout
uses: actions/checkout@v3

- name: "Build Fedora ISO"
- name: Build ISO
run: |
docker run \
--privileged \
--rm \
-t \
-v "$(pwd)":/repo \
fedora:38 \
/bin/bash -c 'cd /repo && ./build.sh'
-v "$PWD":/repo \
ghcr.io/t2linux/fedora-dev:latest \
/repo/build.sh
- name: Artifacts
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: t2linux-fedora-iso
path: ./output/*
name: fedora-iso
path: ./_output/*

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
./output/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
_output/*.iso
22 changes: 9 additions & 13 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
#!/bin/bash
#!/usr/bin/bash

set -eu -o pipefail

dnf install -y --quiet git pykickstart lorax anaconda lorax-lmc-novirt

git clone --quiet --single-branch --depth 1 --branch f38 https://pagure.io/fedora-kickstarts.git /var/fedora-kickstarts
cd /var/fedora-kickstarts
cp -rfv "/repo"/*.ks ./
cd /repo
git clone --quiet --single-branch --depth 1 --branch f38 https://pagure.io/fedora-kickstarts.git fedora-kickstarts && cd fedora-kickstarts
cp -rfv /repo/*.ks ./
sudo ksflatten -c t2linux-fedora-workstation-live.ks -o flat.ks

livemedia-creator --ks flat.ks --no-virt --resultdir /var/lmc --project Fedora-Workstation-Live-t2linux --make-iso --volid Fedora-WS-Live-t2-38-3.0.0 --iso-only --iso-name Fedora-Workstation-Live-t2linux-x86_64-38-3.0.0.iso --releasever 38

cp -rfv /var/lmc/*.iso "/repo"/
cd "/repo"
cp -rfv /var/lmc/*.iso /repo/
cd /repo

mkdir -p ./output
mkdir -p _output
if (( $(stat -c%s *.iso) > 199999999 )); then
mv *.iso ./output/
mv *.iso _output/
else
split -b 2000M -x ./*.iso ./output/Fedora-Workstation-Live-t2linux-x86_64-38-2.0.0.iso.
split -b 2000M -x ./*.iso ./_output/Fedora-Workstation-Live-t2linux-x86_64-38-2.0.0.iso.
fi

0 comments on commit d4852c9

Please sign in to comment.