Skip to content

Commit

Permalink
How many levels can you nest a GHA workflow call?
Browse files Browse the repository at this point in the history
  • Loading branch information
korewaChino committed Dec 29, 2024
1 parent 1d0fbfc commit 154a257
Showing 1 changed file with 52 additions and 49 deletions.
101 changes: 52 additions & 49 deletions .github/workflows/katsu-live-iso.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,59 +85,62 @@ on:

jobs:
live-iso:
strategy:
matrix:
arch: [x86_64, aarch64]
fail-fast: false
runs-on: ${{ matrix.arch == 'x86_64' && 'ubuntu-latest' || 'arm64' }}
container:
image: ghcr.io/terrapkg/builder:f41
options: --privileged -v /dev:/dev
steps:
- name: Install dependencies
run: |
dnf up -y
dnf install -y $DNF_PKGS
dnf clean all
- name: Checkout
uses: actions/checkout@v4
uses: ./.github/workflows/katsu-live-iso.yml
with:
variant: ${{ inputs.variant }}
# strategy:
# matrix:
# arch: [x86_64, aarch64]
# fail-fast: false
# runs-on: ${{ matrix.arch == 'x86_64' && 'ubuntu-latest' || 'arm64' }}
# container:
# image: ghcr.io/terrapkg/builder:f41
# options: --privileged -v /dev:/dev
# steps:
# - name: Install dependencies
# run: |
# dnf up -y
# dnf install -y $DNF_PKGS
# dnf clean all
# - name: Checkout
# uses: actions/checkout@v4

- name: Sanitize artifact name
run: |
name=$(echo ${{ inputs.variant }} | sed 's/\//-/g')
name=$name-${{ inputs.arch }}
# - name: Sanitize artifact name
# run: |
# name=$(echo ${{ inputs.variant }} | sed 's/\//-/g')
# name=$name-${{ inputs.arch }}

# set github variable
echo artifact=$name-${{ inputs.arch }}-live >> $GITHUB_ENV
# Get architecture
# e.g. flagship/flagship-live -> flagship
echo variant=$(echo ${{ inputs.variant }} | cut -d'/' -f1) >> $GITHUB_ENV
# # set github variable
# echo artifact=$name-${{ inputs.arch }}-live >> $GITHUB_ENV
# # Get architecture
# # e.g. flagship/flagship-live -> flagship
# echo variant=$(echo ${{ inputs.variant }} | cut -d'/' -f1) >> $GITHUB_ENV

- name: Build Live ISO
run: |
# loop device fix
if [ "$(df -T /dev | tail -1 |cut -f 1 -d ' ')" = "tmpfs" ]; then
mount -t devtmpfs none /dev
fi
# - name: Build Live ISO
# run: |
# # loop device fix
# if [ "$(df -T /dev | tail -1 |cut -f 1 -d ' ')" = "tmpfs" ]; then
# mount -t devtmpfs none /dev
# fi

rm -rf /etc/rpm/macros.image-language-conf
chcon system_u:object_r:install_exec_t:s0 "$(which katsu)"
pushd katsu
KATSU_KEEP_CHROOT=1 KATSU_LOG=trace katsu -v --output=iso "modules/${{ matrix.variant }}/${{ matrix.variant }}-live.yaml"
# get the ISO name, and then append the arch
# e.g. flagship-live.iso -> flagship-live-x86_64.iso
# rm -rf /etc/rpm/macros.image-language-conf
# chcon system_u:object_r:install_exec_t:s0 "$(which katsu)"
# pushd katsu
# KATSU_KEEP_CHROOT=1 KATSU_LOG=trace katsu -v --output=iso "modules/${{ matrix.variant }}/${{ matrix.variant }}-live.yaml"
# # get the ISO name, and then append the arch
# # e.g. flagship-live.iso -> flagship-live-x86_64.iso

# get the ISO name
iso=$(ls *.iso)
# append the arch
mv $iso $(echo $iso | sed "s/.iso/-${{ matrix.arch }}.iso/")
# # get the ISO name
# iso=$(ls *.iso)
# # append the arch
# mv $iso $(echo $iso | sed "s/.iso/-${{ matrix.arch }}.iso/")

rm -rf katsu-work/
popd
# rm -rf katsu-work/
# popd

- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.artifact }}-iso
path: katsu/*.iso
compression-level: 0
# - name: Upload Artifact
# uses: actions/upload-artifact@v4
# with:
# name: ${{ env.artifact }}-iso
# path: katsu/*.iso
# compression-level: 0

0 comments on commit 154a257

Please sign in to comment.