JSON Build #41
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: ["10"] | |
fail-fast: false | |
runs-on: ${{ matrix.pkg.arch == 'aarch64' && 'ARM64' || 'ubuntu-latest' }} | |
container: | |
image: ghcr.io/terrapkg/builder:el${{ matrix.version }} | |
options: --cap-add=SYS_ADMIN --privileged | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Checkout latest Mock configs | |
uses: actions/checkout@v4 | |
with: | |
repository: terrapkg/mock-configs | |
path: mock-configs | |
- name: Set up git repository | |
run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
- name: Include custom build template instead of package default | |
run: | | |
cp -v mock-configs/terra-el.tpl /etc/mock/templates/ | |
cp -v mock-configs/terra-el-dev.tpl /etc/mock/templates/ | |
- name: Build with Andaman | |
run: | | |
dnf builddep -y `echo ${{ matrix.pkg.pkg }} | sed -E 's@/pkg$@/*.spec@'` | |
anda build ${{ matrix.pkg.pkg }} -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: | | |
subatomic-cli upload --prune \ | |
--server https://subatomic.fyralabs.com \ | |
--token ${{ secrets.SUBATOMIC_TOKEN }} \ | |
terrael${{ matrix.version }} anda-build/rpm/rpms/* | |
- name: Upload source packages to subatomic | |
if: github.event_name == 'push' | |
run: | | |
subatomic-cli upload --prune \ | |
--server https://subatomic.fyralabs.com \ | |
--token ${{ secrets.SUBATOMIC_TOKEN }} \ | |
terrael${{ matrix.version }}-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 |