# for each folder in anda/ # generate a new workflow for each folder in anda/ name: Automatically build packages on: push: paths: - anda/** branches: - f38 pull_request: branches: - f38 merge_group: branches: - f38 workflow_dispatch: workflow_call: jobs: manifest: runs-on: ubuntu-latest outputs: build_matrix: ${{ steps.generate_build_matrix.outputs.build_matrix }} container: image: ghcr.io/terrapkg/builder:f38 options: --cap-add=SYS_ADMIN --privileged steps: - name: Set workspace as safe run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - name: Checkout uses: actions/checkout@v3 with: fetch-depth: 0 - name: Generate build matrix id: generate_build_matrix run: | anda ci >> $GITHUB_OUTPUT build: needs: manifest strategy: matrix: pkg: ${{ fromJson(needs.manifest.outputs.build_matrix) }} version: ["38"] fail-fast: false runs-on: ${{ matrix.pkg.arch == 'aarch64' && 'ARM64' || 'ubuntu-latest' }} container: image: ghcr.io/terrapkg/builder:f38 options: --cap-add=SYS_ADMIN --privileged steps: - name: Checkout uses: actions/checkout@v3 with: fetch-depth: 0 - uses: terrapkg/anda-build@main if: github.event_name != 'push' with: name: "${{ matrix.pkg.pkg }}" mockConfig: terra-${{ matrix.version }}-${{ matrix.pkg.arch }} andaRepo: https://github.com/terrapkg/subatomic-repos/raw/main/terra${{ matrix.version }}.repo - uses: terrapkg/anda-build@main if: github.event_name == 'push' with: name: "${{ matrix.pkg.pkg }}" mockConfig: terra-${{ 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: 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@v3 with: name: ${{ steps.art.outputs.name }} path: anda-build/rpm/rpms/* - name: Upload packages to subatomic if: github.event_name == 'push' run: | subatomic-cli upload --prune \ --server https://subatomic.fyralabs.com \ --token ${{ secrets.SUBATOMIC_TOKEN }} \ terra${{ matrix.version }} anda-build/rpm/rpms/* - name: Notify Madoguchi (Success) if: success() && github.event_name == 'push' run: ./.github/workflows/mg.sh true ${{matrix.pkg.pkg}} ${{matrix.version}} ${{matrix.pkg.arch}} ${{github.run_id}} ${{secrets.MADOGUCHI_JWT}} - name: Notify Madoguchi (Failure) if: ( cancelled() || failure() ) && github.event_name == 'push' run: ./.github/workflows/mg.sh false ${{matrix.pkg.pkg}} ${{matrix.version}} ${{matrix.pkg.arch}} ${{github.run_id}} ${{secrets.MADOGUCHI_JWT}}