|
| 1 | +--- |
| 2 | +name: Build ISO |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - 'main' |
| 8 | + paths-ignore: |
| 9 | + - '**/README.md' |
| 10 | + workflow_dispatch: |
| 11 | + |
| 12 | +concurrency: |
| 13 | + group: ${{ github.workflow }}-${{ github.ref || github.run_id }} |
| 14 | + cancel-in-progress: true |
| 15 | + |
| 16 | +jobs: |
| 17 | + set-env: |
| 18 | + runs-on: ubuntu-latest |
| 19 | + outputs: |
| 20 | + LATEST_TAG: ${{ steps.set.outputs.LATEST_TAG }} |
| 21 | + REGISTRY: ${{ steps.set.outputs.REGISTRY }} |
| 22 | + REGISTRY_USER: ${{ steps.set.outputs.REGISTRY_USER }} |
| 23 | + PLATFORMS: ${{ steps.set.outputs.PLATFORMS }} |
| 24 | + IMAGE_PATH: ${{ steps.set.outputs.IMAGE_PATH }} |
| 25 | + IMAGE_NAME: ${{ steps.set.outputs.IMAGE_NAME }} |
| 26 | + IS_SIGNED: ${{ steps.set.outputs.IS_SIGNED }} |
| 27 | + steps: |
| 28 | + - name: Set environment variables |
| 29 | + id: set |
| 30 | + run: | |
| 31 | + # Pick a latest tag based on the event type |
| 32 | + if [[ "${{ github.ref }}" != "refs/heads/${{ github.event.repository.default_branch }}" ]]; then |
| 33 | + echo "LATEST_TAG=${{ github.ref_name }}" >> $GITHUB_OUTPUT |
| 34 | + else |
| 35 | + echo "LATEST_TAG=latest" >> $GITHUB_OUTPUT |
| 36 | + fi |
| 37 | +
|
| 38 | + REGISTRY=ghcr.io |
| 39 | + REGISTRY_USER=${{ github.actor }} |
| 40 | + IMAGE_PATH=${{ github.repository_owner }} |
| 41 | + PLATFORMS="amd64,arm64" |
| 42 | +
|
| 43 | + echo "REGISTRY=${REGISTRY}" >> $GITHUB_OUTPUT |
| 44 | + echo "REGISTRY_USER=${REGISTRY_USER}" >> $GITHUB_OUTPUT |
| 45 | + echo "IMAGE_PATH=${IMAGE_PATH}" >> $GITHUB_OUTPUT |
| 46 | + echo "IMAGE_NAME=${REGISTRY}/${IMAGE_PATH}/${{ github.event.repository.name }}" >> $GITHUB_OUTPUT |
| 47 | + echo "PLATFORMS=${PLATFORMS}" >> $GITHUB_OUTPUT |
| 48 | +
|
| 49 | + # This is a workaround so that the expansion of secrets.SIGNING_SECRET doesn't break the if statement |
| 50 | + SECRET=$(cat <<EOF |
| 51 | + ${{ secrets.SIGNING_SECRET }} |
| 52 | + EOF |
| 53 | + ) |
| 54 | + if [ -z "${SECRET}" ]; then |
| 55 | + echo "IS_SIGNED=false" >> $GITHUB_OUTPUT |
| 56 | + else |
| 57 | + echo "IS_SIGNED=true" >> $GITHUB_OUTPUT |
| 58 | + fi |
| 59 | +
|
| 60 | + build-iso: |
| 61 | + name: Build ISO |
| 62 | + needs: [set-env, build-image, test-image] |
| 63 | + uses: AlmaLinux/desktop-bootc-ci/.github/workflows/build-iso.yml@v3 |
| 64 | + with: |
| 65 | + image-name: "${{ github.event.repository.name }}" |
| 66 | + image: ${{ needs.build-image.outputs.image-ref }}@${{ needs.build-image.outputs.digest }} |
| 67 | + update_origin_ref: "${{ needs.set-env.outputs.IMAGE_NAME }}:${{ needs.set-env.outputs.LATEST_TAG }}" |
| 68 | + update_is_signed: ${{ needs.set-env.outputs.IS_SIGNED == 'true' }} |
| 69 | + config-file: ./iso.toml |
| 70 | + platforms: ${{ needs.set-env.outputs.PLATFORMS }} |
| 71 | + REGISTRY: ${{ needs.set-env.outputs.REGISTRY }} |
| 72 | + REGISTRY_USER: ${{ needs.set-env.outputs.REGISTRY_USER }} |
| 73 | + secrets: |
| 74 | + REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments