Mass Rebuild #17
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
# for each folder in ultramarine/ | |
# generate a new workflow for each folder in ultramarine/ | |
name: Mass Rebuild | |
on: | |
workflow_dispatch: | |
workflow_call: | |
jobs: | |
manifest: | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/terrapkg/builder:f41 | |
options: --cap-add=SYS_ADMIN --privileged | |
outputs: | |
build_matrix: ${{ steps.generate_build_matrix.outputs.build_matrix }} | |
# check out the repo | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Generate Build matrix | |
id: generate_build_matrix | |
# generate build matrix by checking out changes in ultramarine/ | |
run: | | |
git config --global --add safe.directory /__w/ultramarine-pkgs/ultramarine-pkgs | |
git config --global user.email "[email protected]" | |
git config --global user.name "Your Name" | |
init=$(git rev-list HEAD | tail -n 1) | |
git diff ${init}..HEAD > a.diff | |
git checkout $init | |
git apply a.diff | |
git add * | |
git commit -a -m a | |
anda ci >> $GITHUB_OUTPUT | |
build: | |
needs: manifest | |
strategy: | |
matrix: | |
pkg: ${{ fromJson(needs.manifest.outputs.build_matrix) }} | |
version: ["41"] | |
fail-fast: false | |
#if: ${{ matrix.changed_folders != '' }} | |
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: Include custom build template instead of package default | |
run: | | |
cp -v ultramarine/ultramarine-mock-configs/ultramarine.tpl /etc/mock/templates/ultramarine.tpl | |
- name: Build with Andaman | |
run: anda build ${{ matrix.pkg.pkg }} --package rpm -c ultramarine/ultramarine-mock-configs/ultramarine-${{ matrix.version }}-${{ matrix.pkg.arch }}.cfg | |
- 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 }} | |
path: | | |
anda-build/rpm/rpms/* | |
anda-build/rpm/srpm/* | |
- name: Upload packages to subatomic | |
if: github.event_name == 'push' | |
run: | | |
subatomic-cli upload --prune \ | |
--server https://subatomic.fyralabs.com \ | |
--token ${{ secrets.SUBATOMIC_TOKEN }} \ | |
um${{ 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 }} \ | |
um${{ matrix.version }}-source anda-build/rpm/srpm/* |