JSON Build #47
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: JSON Build | |
on: | |
workflow_dispatch: | |
inputs: | |
packages: | |
description: "Packages to Build" | |
required: true | |
jobs: | |
build: | |
strategy: | |
matrix: | |
pkg: ${{ fromJson(inputs.packages) }} | |
version: ["rawhide"] | |
fail-fast: false | |
runs-on: ${{ matrix.pkg.arch == 'aarch64' && 'ARM64' || 'ubuntu-latest' }} | |
container: | |
image: ghcr.io/terrapkg/builder:f${{ matrix.version }} | |
options: --cap-add=SYS_ADMIN --privileged | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up git repository | |
run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
- name: CI Setup Script | |
if: ${{ !contains(matrix.pkg.labels, 'mock') }} | |
run: | | |
dir=$(dirname ${{ matrix.pkg.pkg }}) | |
if [ -f $dir/ci_setup.rhai ]; then | |
anda run $dir/ci_setup.rhai --labels script_path=$dir/ci_setup.rhai | |
fi | |
- name: Install Build Dependencies | |
if: ${{ !contains(matrix.pkg.labels, 'mock') }} | |
run: | | |
dir=$(dirname ${{ matrix.pkg.pkg }}) | |
dnf5 builddep -y ${dir}/*.spec | |
- name: Build with Andaman | |
run: anda build ${{ matrix.pkg.pkg }} -c terra-${{ matrix.version }}-${{ matrix.pkg.arch }} ${{ contains(matrix.pkg.labels, 'mock') && '' || '-rrpmbuild' }} | |
- name: Generating artifact name | |
id: art | |
run: | | |
NAME=${{ matrix.pkg.pkg }}-${{ matrix.pkg.arch }}-${{ matrix.version }} | |
x=${NAME//\//@} | |
echo "name=$x" >> $GITHUB_OUTPUT | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ steps.art.outputs.name }} | |
compression-level: 0 # The RPMs are already compressed :p | |
path: | | |
anda-build/rpm/rpms/* | |
anda-build/rpm/srpm/* | |
- name: Upload packages to subatomic | |
run: | | |
subrepo="${{ matrix.pkg.labels.subrepo }}" | |
subatomic-cli upload --prune \ | |
--server https://subatomic.fyralabs.com \ | |
--token ${{ secrets.SUBATOMIC_TOKEN }} \ | |
terra${{ matrix.version }}${{ matrix.pkg.labels['subrepo'] && '-$subrepo' || '' }} anda-build/rpm/rpms/* | |
- name: Upload source packages to subatomic | |
run: | | |
subrepo="${{ matrix.pkg.labels.subrepo }}" | |
subatomic-cli upload --prune \ | |
--server https://subatomic.fyralabs.com \ | |
--token ${{ secrets.SUBATOMIC_TOKEN }} \ | |
terra${{ matrix.version }}${{ matrix.pkg.labels['subrepo'] && '-$subrepo' || '' }}-source anda-build/rpm/srpm/* | |
- name: Notify Madoguchi (Success) | |
if: success() | |
run: ./.github/workflows/mg.sh true ${{matrix.pkg.pkg}} ${{matrix.version}} ${{matrix.pkg.arch}} ${{github.run_id}} ${{secrets.MADOGUCHI_JWT}} $GITHUB_SHA | |
- name: Notify Madoguchi (Failure) | |
if: cancelled() || failure() | |
run: ./.github/workflows/mg.sh false ${{matrix.pkg.pkg}} ${{matrix.version}} ${{matrix.pkg.arch}} ${{github.run_id}} ${{secrets.MADOGUCHI_JWT}} $GITHUB_SHA |