diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..84908b1 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,63 @@ +name: Build + +on: + workflow_call: + inputs: + file: + required: true + type: string + description: Dockerfile to use + tag: + required: true + type: string + description: Docker tag to generate + load: + required: false + type: boolean + default: false + description: Load docker image + +env: + REGISTRY: ghcr.io + IMAGE: ${{ github.repository_owner }}/qt + +jobs: + build: + name: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Login to GHCR + uses: docker/login-action@v2 + with: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + registry: ${{ env.REGISTRY }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE }} + flavor: | + latest=false + tags: | + type=raw,value=${{ inputs.tag }} + type=ref,event=tag,enable=${{ inputs.tag == 'latest' }} + + - name: Build + uses: docker/build-push-action@v4 + with: + file: ${{ inputs.file }} + sbom: true + provenance: true + load: ${{ inputs.load || 'false' }} + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..3e90fdb --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,57 @@ +name: Release + +on: + push: + tags: + - '**' + branches: + - master + +permissions: + id-token: write + contents: read + packages: write + +jobs: + build: + strategy: + fail-fast: false + matrix: + include: + - name: static + file: Dockerfile.static + tag: static + - name: dynamic + file: Dockerfile + tag: latest + - name: MXE + file: Dockerfile.mxe + tag: mxe + name: ${{ matrix.name }} + uses: ./.github/workflows/build.yaml + with: + file: ${{ matrix.file }} + tag: ${{ matrix.tag }} + mxe_win: + needs: [build] + strategy: + fail-fast: false + matrix: + include: + - name: Win32 Static + file: Dockerfile.win32s + tag: win32s + - name: Win32 Dynamic + file: Dockerfile.win32d + tag: win32d + - name: Win64 Static + file: Dockerfile.win64s + tag: win64s + - name: Win64 Dynamic + file: Dockerfile.win64d + tag: win64d + name: MXE ${{ matrix.name }} + uses: ./.github/workflows/build.yaml + with: + file: ${{ matrix.file }} + tag: ${{ matrix.tag }}