Skip to content

Commit

Permalink
feat(ci): cleanup workflows (#17)
Browse files Browse the repository at this point in the history
* feat(ci): cleanup workflows

Signed-off-by: m2 <69128853+m2Giles@users.noreply.github.com>

* fixup! feat(ci): cleanup workflows

Signed-off-by: m2 <69128853+m2Giles@users.noreply.github.com>

* fixup! fixup! feat(ci): cleanup workflows

Signed-off-by: m2 <69128853+m2Giles@users.noreply.github.com>

* fixup! fixup! fixup! feat(ci): cleanup workflows

Signed-off-by: m2 <69128853+m2Giles@users.noreply.github.com>

* use matrices

Signed-off-by: m2 <69128853+m2Giles@users.noreply.github.com>

* change back naming

Signed-off-by: m2 <69128853+m2Giles@users.noreply.github.com>

* cleanup flatpak list

Signed-off-by: m2 <69128853+m2Giles@users.noreply.github.com>

* fixup! use matrices

Signed-off-by: m2 <69128853+m2Giles@users.noreply.github.com>

* naming

Signed-off-by: m2 <69128853+m2Giles@users.noreply.github.com>

* fixup! naming

Signed-off-by: m2 <69128853+m2Giles@users.noreply.github.com>

---------

Signed-off-by: m2 <69128853+m2Giles@users.noreply.github.com>
  • Loading branch information
m2Giles authored Jan 6, 2025
1 parent db65860 commit acd6cbe
Show file tree
Hide file tree
Showing 7 changed files with 110 additions and 103 deletions.
31 changes: 31 additions & 0 deletions .github/actions/get-images/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Get Images for Build
description: Get Images for Build

inputs:
image_flavor:
description: "Types of Image to Build (Bazzite, Desktop, Server)"
required: true

outputs:
images:
description: "List of Images that will be built"
value: ${{ steps.images.outputs.images }}

runs:
using: "composite"
steps:
- name: Get Images for Build
id: images
shell: bash
run: |
case "${{ inputs.image_flavor }}" in
"Bazzite")
images='["bazzite", "bazzite-deck"]'
;;
"Desktop")
images='["aurora", "aurora-nvidia", "bluefin", "bluefin-nvidia", "cosmic", "cosmic-nvidia"]'
;;
"Server")
images='["ucore", "ucore-nvidia"]'
esac
echo "images=$images" >> "$GITHUB_OUTPUT"
18 changes: 18 additions & 0 deletions .github/actions/install-just/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Install Just
description: Install Just from Github Release

runs:
using: "composite"
steps:
- name: Install Just
shell: bash
run: |
set -eoux pipefail
while [[ "${JUST_VERSION:-}" =~ null || -z "${JUST_VERSION:-}" ]]
do
JUST_VERSION=$(curl -L https://api.github.com/repos/casey/just/releases/latest | jq -r '.tag_name')
done
curl --retry 3 -sSLO https://github.com/casey/just/releases/download/${JUST_VERSION}/just-${JUST_VERSION}-x86_64-unknown-linux-musl.tar.gz
tar -zxvf just-${JUST_VERSION}-x86_64-unknown-linux-musl.tar.gz -C /tmp just
sudo mv /tmp/just /usr/local/bin/just
rm -f just-${JUST_VERSION}-x86_64-unknown-linux-musl.tar.gz
38 changes: 20 additions & 18 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ name: Build m2os Images
on:
workflow_call:
inputs:
images:
description: "Images for the build"
required: true
type: string
image_flavor:
type: string

Expand All @@ -19,8 +15,24 @@ env:
SET_X: 1

jobs:
get-images:
name: Get ${{ inputs.image_flavor }} Images for Build
outputs:
images: ${{ steps.images.outputs.images }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Get Images for Build
id: images
uses: ./.github/actions/get-images
with:
image_flavor: ${{ inputs.image_flavor }}

build-image:
name: Build ${{ inputs.image_flavor }} Images (${{ matrix.image }})
needs: get-images
runs-on: ubuntu-24.04
continue-on-error: false
permissions:
Expand All @@ -30,23 +42,13 @@ jobs:
strategy:
fail-fast: false
matrix:
image: ${{ fromJson(inputs.images) }}
image: ["${{ fromJson(needs.get-images.outputs.images) }}"]
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- name: Install Just
shell: bash
run: |
set -eoux pipefail
while [[ "${JUST_VERSION:-}" =~ null || -z "${JUST_VERSION:-}" ]]
do
JUST_VERSION=$(curl -L https://api.github.com/repos/casey/just/releases/latest | jq -r '.tag_name')
done
curl --retry 3 -sSLO https://github.com/casey/just/releases/download/${JUST_VERSION}/just-${JUST_VERSION}-x86_64-unknown-linux-musl.tar.gz
tar -zxvf just-${JUST_VERSION}-x86_64-unknown-linux-musl.tar.gz -C /tmp just
sudo mv /tmp/just /usr/local/bin/just
rm -f just-${JUST_VERSION}-x86_64-unknown-linux-musl.tar.gz
uses: ./.github/actions/install-just

- name: Check Just Syntax
shell: bash
Expand Down Expand Up @@ -129,13 +131,13 @@ jobs:
COSIGN_PRIVATE_KEY: ${{ secrets.SIGNING_SECRET }}

check:
name: Check all builds successful
name: Check Build ${{ inputs.image_flavor }} Images Successful
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
needs: [build-image]
steps:
- name: Exit on failure
if: ${{ needs.build-image.result == 'failure' }}
if: ${{ !success() }}
shell: bash
run: exit 1
- name: Exit
Expand Down
41 changes: 18 additions & 23 deletions .github/workflows/build-iso.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@ name: Build m2os ISOs
on:
workflow_dispatch:
inputs:
images:
description: "The images to build, Make sure it matches"
type: choice
options:
- '["aurora", "aurora-nvidia", "bluefin", "bluefin-nvidia", "cosmic", "cosmic-nvidia"]'
- '["bazzite", "bazzite-deck"]'
default: '["aurora", "aurora-nvidia", "bluefin", "bluefin-nvidia", "cosmic", "cosmic-nvidia"]'
image_flavor:
description: "The image flavor to build, Make sure it matches"
type: choice
Expand All @@ -19,10 +12,6 @@ on:

workflow_call:
inputs:
images:
description: "The images to build"
required: true
type: string
image_flavor:
type: string
required: true
Expand All @@ -36,8 +25,24 @@ concurrency:
cancel-in-progress: true

jobs:
get-images:
name: Get Images for Build
outputs:
images: ${{ steps.images.outputs.images }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Get Images for Build
id: images
uses: ./.github/actions/get-images
with:
image_flavor: ${{ inputs.image_flavor }}

build-iso:
name: Build ${{ inputs.image_flavor }} ISOs (${{ matrix.image }})
needs: get-images
outputs:
url: ${{ steps.url.outputs.url }}
runs-on: ubuntu-latest
Expand All @@ -48,23 +53,13 @@ jobs:
strategy:
fail-fast: false
matrix:
image: ["${{ fromJson(inputs.images) }}"]
image: ["${{ fromJson(needs.get-images.outputs.images) }}"]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Just
shell: bash
run: |
set -eoux pipefail
while [[ "${JUST_VERSION:-}" =~ null || -z "${JUST_VERSION:-}" ]]
do
JUST_VERSION=$(curl -L https://api.github.com/repos/casey/just/releases/latest | jq -r '.tag_name')
done
curl -sSLO https://github.com/casey/just/releases/download/${JUST_VERSION}/just-${JUST_VERSION}-x86_64-unknown-linux-musl.tar.gz
tar -zxvf just-${JUST_VERSION}-x86_64-unknown-linux-musl.tar.gz -C /tmp just
sudo mv /tmp/just /usr/local/bin/just
rm -f just-${JUST_VERSION}-x86_64-unknown-linux-musl.tar.gz
uses: ./.github/actions/install-just

- name: Check Just Syntax
shell: bash
Expand Down
53 changes: 17 additions & 36 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
- cron: "41 6 * * 0" # 6:41 UTC Sunday
- cron: "41 6 * * 1,2,3,4,5,6" # 6:41 UTC Monday-Saturday
push:
branches:
branches:
- main
pull_request:
branches:
Expand All @@ -18,49 +18,30 @@ permissions:
id-token: write

jobs:
build-image-desktop:
name: Desktop Images
build-image:
name: Build Images
uses: ./.github/workflows/build-image.yml
secrets: inherit
strategy:
fail-fast: false
matrix:
image_flavor: ["Desktop", "Bazzite", "Server"]
with:
images: '["aurora", "aurora-nvidia", "bluefin", "bluefin-nvidia", "cosmic", "cosmic-nvidia"]'
image_flavor: Desktop

build-image-bazzite:
name: Bazzite Images
uses: ./.github/workflows/build-image.yml
secrets: inherit
with:
images: '["bazzite", "bazzite-deck"]'
image_flavor: Bazzite

build-image-server:
name: Server Images
uses: ./.github/workflows/build-image.yml
secrets: inherit
with:
images: '["ucore", "ucore-nvidia"]'
image_flavor: Server

build-iso-desktop:
name: Desktop ISOs
uses: ./.github/workflows/build-iso.yml
secrets: inherit
needs: [build-image-desktop, build-image-server]
with:
images: '["aurora", "aurora-nvidia", "bluefin", "bluefin-nvidia", "cosmic", "cosmic-nvidia"]'
image_flavor: Desktop
image_flavor: ${{ matrix.image_flavor }}

build-iso-bazzite:
name: Bazzite ISOs
build-iso:
name: Build ISOs
uses: ./.github/workflows/build-iso.yml
secrets: inherit
needs: build-image-bazzite
needs: [build-image]
strategy:
fail-fast: false
matrix:
image_flavor: ["Desktop", "Bazzite"]
with:
images: '["bazzite", "bazzite-deck"]'
image_flavor: Bazzite
image_flavor: ${{ matrix.image_flavor }}

create-release:
name: Create Release
needs: [build-iso-desktop, build-iso-bazzite]
needs: [build-iso]
uses: ./.github/workflows/create-release.yml
12 changes: 1 addition & 11 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,7 @@ jobs:
github-token: ${{ github.token }}

- name: Install Just
shell: bash
run: |
set -eoux pipefail
while [[ "${JUST_VERSION:-}" =~ null || -z "${JUST_VERSION:-}" ]]
do
JUST_VERSION=$(curl -L https://api.github.com/repos/casey/just/releases/latest | jq -r '.tag_name')
done
curl -sSLO https://github.com/casey/just/releases/download/${JUST_VERSION}/just-${JUST_VERSION}-x86_64-unknown-linux-musl.tar.gz
tar -zxvf just-${JUST_VERSION}-x86_64-unknown-linux-musl.tar.gz -C /tmp just
sudo mv /tmp/just /usr/local/bin/just
rm -f just-${JUST_VERSION}-x86_64-unknown-linux-musl.tar.gz
uses: ./.github/actions/install-just

- name: Check Just Syntax
shell: bash
Expand Down
20 changes: 5 additions & 15 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -309,34 +309,24 @@ build-iso image="bluefin" ghcr="0" clean="0":
ADDITIONAL_FLATPAKS=(
app/com.discordapp.Discord/x86_64/stable
app/com.google.Chrome/x86_64/stable
app/com.microsoft.Edge/x86_64/stable
app/com.spotify.Client/x86_64/stable
app/org.gimp.GIMP/x86_64/stable
app/org.keepassxc.KeePassXC/x86_64/stable
app/org.libreoffice.LibreOffice/x86_64/stable
app/org.prismlauncher.PrismLauncher/x86_64/stable
)
)
if [[ "{{ image }}" =~ cosmic ]]; then
ADDITIONAL_FLATPAKS+=(app/org.gnome.World.PikaBackup/x86_64/stable)
fi
if [[ "{{ image }}" =~ aurora|bluefin|cosmic ]]; then
ADDITIONAL_FLATPAKS+=(
app/com.github.Matoking.protontricks/x86_64/stable
app/io.github.fastrizwaan.WineZGUI/x86_64/stable
app/org.gnome.World.PikaBackup/x86_64/stable
app/it.mijorus.gearlever/x86_64/stable
app/com.vysp3r.ProtonPlus/x86_64/stable
runtime/org.freedesktop.Platform.VulkanLayer.MangoHud/x86_64/23.08
runtime/org.freedesktop.Platform.VulkanLayer.vkBasalt/x86_64/23.08
runtime/org.freedesktop.Platform.VulkanLayer.OBSVkCapture/x86_64/23.08
runtime/com.obsproject.Studio.Plugin.OBSVkCapture/x86_64/stable
runtime/com.obsproject.Studio.Plugin.Gstreamer/x86_64/stable
runtime/com.obsproject.Studio.Plugin.GStreamerVaapi/x86_64/stable
runtime/org.gtk.Gtk3theme.adw-gtk3/x86_64/3.22
runtime/org.gtk.Gtk3theme.adw-gtk3-dark/x86_64/3.22
)
)
fi
if [[ "{{ image }}" =~ bazzite ]]; then
ADDITIONAL_FLATPAKS+=(app/org.gnome.World.PikaBackup/x86_64/stable)
if [[ "{{ image }}" =~ aurora|bluefin ]]; then
ADDITIONAL_FLATPAKS+=(app/it.mijorus.gearlever/x86_64/stable)
fi
FLATPAK_REFS=()
while IFS= read -r line; do
Expand Down

0 comments on commit acd6cbe

Please sign in to comment.