Skip to content

feat: update bluefin wallpapers #137

feat: update bluefin wallpapers

feat: update bluefin wallpapers #137

Workflow file for this run

name: Build packages in CI
on:
merge_group:
pull_request:
jobs:
changed_files:
runs-on: ubuntu-latest
name: Get changed files
outputs:
all_changed_files: ${{ steps.changed-package-files.outputs.all_changed_files }}
any_changed: ${{ steps.changed-package-files.outputs.any_changed }}
specs: ${{ steps.packages.outputs.specs }}
steps:
- uses: actions/checkout@v4
- name: Get directories with spec files
id: specdirs
run: |
set -x
FILESLIST=./files.txt
# The extra xargs there is so that the changed-files action can find all the files
find . -type f -iname '*.spec' -exec 'dirname' '{}' ';' 2>/dev/null | xargs -I{} echo "{}/**" > $FILESLIST
echo "fileslist=$FILESLIST" >> $GITHUB_OUTPUT
- name: Get all changed files from package directores
id: changed-package-files
uses: tj-actions/changed-files@v45
with:
files_from_source_file: ${{ steps.specdirs.outputs.fileslist }}
- name: Get all packages that need to be rebuilt
id: packages
if: steps.changed-package-files.outputs.any_changed == 'true'
env:
ALL_CHANGED_FILES: ${{ steps.changed-package-files.outputs.all_changed_files }}
run: |
set -x
MATRIX="{\"specs\":[]}"
for file in ${ALL_CHANGED_FILES}; do
for spec in $(dirname $file)/*.spec ; do
[ -e "$spec" ] && MATRIX=$(echo $MATRIX | jq -c ".specs += [\"$spec\"]")
done
done
echo "specs=$(echo $MATRIX | jq -c '.specs')" >> $GITHUB_OUTPUT
build_packages:
runs-on: ${{ matrix.platform == 'amd64' && 'ubuntu-24.04' || 'ubuntu-24.04-arm' }}
needs: changed_files
name: Build RPM package
if: needs.changed_files.outputs.any_changed == 'true'
strategy:
fail-fast: false
matrix:
platform: ["arm64","amd64"]
# These are our target environments
# FIXME: renovate rule for this would be awesome
chroot: ["fedora-40", "fedora-41", "epel-10"]
spec: ${{ fromJson(needs.changed_files.outputs.specs) }}
steps:
- uses: actions/checkout@v4
- name: Install dependencies
if: matrix.platform == 'arm64'
run: |
sudo apt update -y
sudo apt install -y \
podman
- name: Setup Just
uses: extractions/setup-just@dd310ad5a97d8e7b41793f8ef055398d51ad4de6 # v2
- name: Build ${{ matrix.spec }}
id: build_package
run: |
set -x
just=$(which just)
mkdir -p containers
MOCK_DIR=./mock
CONTAINERS_DIR=./containers
SOURCES_DIR=.
export CONTAINERS_DIR
$just build ${{ matrix.spec }} -r ${{ matrix.chroot }}-$(arch)
SKIPPED_ARCH=false
if [ -e "$SOURCES_DIR/arch_skipped" ] ; then
SKIPPED_ARCH=true
fi
sudo chown -R $(id -u):$(id -g) $MOCK_DIR
echo "mock_dir=$MOCK_DIR" >> "$GITHUB_OUTPUT"
echo "containers_dir=$CONTAINERS_DIR" >> "$GITHUB_OUTPUT"
echo "sources_dir=$SOURCES_DIR" >> "$GITHUB_OUTPUT"
echo "skipped_arch=$SKIPPED_ARCH" >> "$GITHUB_OUTPUT"
echo "package=$(basename "${{ matrix.spec }}" ".spec")" >> "$GITHUB_OUTPUT"
- name: Upload to Job Artifacts
if: steps.build_package.outputs.skipped_arch == 'false'
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4
with:
name: ${{ matrix.chroot }}-${{ matrix.platform }}-${{ steps.build_package.outputs.package }}
if-no-files-found: error
path: |
${{ steps.build_package.outputs.mock_dir }}/**/*.rpm
check:
name: Check all builds successful
if: always()
runs-on: ubuntu-latest
needs: [build_packages]
steps:
- name: Check Jobs
env:
JOBS: ${{ toJson(needs) }}
run: |
echo "Job status:"
echo $JOBS | jq -r 'to_entries[] | " - \(.key): \(.value.result)"'
for i in $(echo $JOBS | jq -r 'to_entries[] | .value.result'); do
if [ "$i" != "success" ] && [ "$i" != "skipped" ]; then
echo ""
echo "Status check not okay!"
exit 1
fi
done