mirror of
https://github.com/terrapkg/packages.git
synced 2026-06-05 19:32:18 +00:00
59 lines
2.1 KiB
YAML
59 lines
2.1 KiB
YAML
# for each folder in anda/
|
|
# generate a new workflow for each folder in anda/
|
|
name: Automatically build packages
|
|
on:
|
|
push:
|
|
paths:
|
|
- anda/**
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
workflow_call:
|
|
|
|
jobs:
|
|
manifest:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
build_matrix: ${{ steps.parse.outputs.b }}
|
|
steps:
|
|
- id: files
|
|
uses: jitterbit/get-changed-files@v1
|
|
- id: parse
|
|
run: echo "${{ steps.files.outputs.added_modified }}" | sed 's/ /\n/g' | sed 's@(.*)/.*@\1/@g/' | jq -R . | jq -s . | jq -c . | sed 's/^/b=/' >> $GITHUB_OUTPUT
|
|
|
|
build:
|
|
needs: manifest
|
|
strategy:
|
|
matrix:
|
|
pkg: ${{ fromJson(needs.manifest.outputs.build_matrix) }}
|
|
version: ["37"]
|
|
fail-fast: false
|
|
#if: ${{ matrix.changed_folders != '' }}
|
|
runs-on: ${{ matrix.pkg.arch == 'aarch64' && 'ARM64' || 'ubuntu-latest' }}
|
|
container:
|
|
image: registry.fedoraproject.org/fedora:37
|
|
options: --cap-add=SYS_ADMIN --privileged
|
|
steps:
|
|
- name: Install repositories
|
|
run: |
|
|
sudo dnf install -y dnf-plugins-core
|
|
sudo dnf config-manager --add-repo https://github.com/terrapkg/subatomic-repos/raw/main/terra${{ matrix.version }}.repo
|
|
sudo dnf install -y anda-mock-configs subatomic-cli anda mock rpm-build mock-scm
|
|
|
|
- uses: terrapkg/anda-build@main
|
|
with:
|
|
name: "${{ matrix.pkg.pkg }}"
|
|
mockConfig: anda-${{ matrix.version }}-${{ matrix.pkg.arch }}
|
|
extraArgs: -D "sccache_bucket ${{secrets.SCCACHE_BUCKET}}" -D "sccache_endpoint ${{secrets.SCCACHE_ENDPOINT}}" -D "sccache_secret ${{secrets.SCCACHE_SECRET}}" -D "sccache_accesskey ${{secrets.SCCACHE_ACCESSKEY}}"
|
|
andaRepo: https://github.com/terrapkg/subatomic-repos/raw/main/terra${{ matrix.version }}.repo
|
|
|
|
- name: Install Subatomic client
|
|
run: sudo dnf install -y subatomic-cli
|
|
|
|
- name: Upload packages to subatomic
|
|
run: |
|
|
subatomic-cli upload --prune \
|
|
--server https://subatomic.fyralabs.com \
|
|
--token ${{ secrets.SUBATOMIC_TOKEN }} \
|
|
terra${{ matrix.version }} anda-build/rpm/rpms/*
|