Modify actions to run in parallel #71
Workflow file for this run
This file contains hidden or 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: Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| - "test-v*" | |
| pull_request: | |
| permissions: write-all | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| strategy: | |
| max-parallel: 2 | |
| fail-fast: true | |
| matrix: | |
| arch: [x86_64, aarch64] | |
| runtime: [none, docker, containerd, incus] | |
| include: | |
| - arch: x86_64 | |
| os: ubuntu-latest | |
| - arch: aarch64 | |
| os: ubuntu-24.04-arm | |
| runs-on: ${{ matrix.os }} | |
| name: build-${{ matrix.arch }}-${{ matrix.runtime }} | |
| timeout-minutes: 180 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 1 | |
| persist-credentials: false | |
| - name: Build | |
| run: | | |
| make image OS_ARCH=${{ matrix.arch }} RUNTIME=${{ matrix.runtime }} | |
| ls -lah dist/img | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: img-${{ matrix.arch }}-${{ matrix.runtime }} | |
| path: dist/img/*-${{ matrix.runtime }}.* | |
| overwrite: true | |
| retention-days: 1 | |
| compression-level: 0 | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| if: github.event_name != 'pull_request' | |
| permissions: | |
| contents: write | |
| actions: write | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 1 | |
| persist-credentials: false | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: dist/img | |
| - name: Create | |
| run: > | |
| tag="${GITHUB_REF##*/}" | |
| gh release create "${tag}" --draft --title "${tag}" dist/img/*/*.raw.gz dist/img/*/*.sha512sum | |
| - name: Delete build artifacts | |
| if: always() | |
| run: | | |
| gh api repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts \ | |
| --jq '.artifacts[].id' | xargs -r -I {} gh api -X DELETE repos/${{ github.repository }}/actions/artifacts/{} | |