Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve builds #5

Merged
merged 2 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 22 additions & 14 deletions .github/workflows/build-iso.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,53 @@
name: Build Fedora ISO

on:
workflow_dispatch:
push:

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
build:
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
with:
submodules: recursive

- 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
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "fedora-kickstarts"]
path = fedora-kickstarts
url = https://pagure.io/fedora-kickstarts
branch = "f38"
21 changes: 4 additions & 17 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
#!/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/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"

mkdir -p ./output
if (( $(stat -c%s *.iso) > 199999999 )); then
mv *.iso ./output/
else
split -b 2000M -x ./*.iso ./output/Fedora-Workstation-Live-t2linux-x86_64-38-2.0.0.iso.
fi
mkdir -p _output && mv /var/lmc/*.iso _output/
1 change: 1 addition & 0 deletions fedora-kickstarts
Submodule fedora-kickstarts added at 69c726