From c6230ff8ca3948713db0f37cc6bfa06d1476370f Mon Sep 17 00:00:00 2001 From: Malte Poll <1780588+malt3@users.noreply.github.com> Date: Mon, 10 Jul 2023 10:21:48 +0200 Subject: [PATCH] ci: add constellation-windows-amd64.exe to release artifacts uploaded to GitHub (#2075) --- .github/actions/build_cli/action.yml | 4 +-- .github/workflows/release-cli.yml | 48 ++++++++++++++++++++++++++-- 2 files changed, 47 insertions(+), 5 deletions(-) diff --git a/.github/actions/build_cli/action.yml b/.github/actions/build_cli/action.yml index bef9f9e6a..d2e308a36 100644 --- a/.github/actions/build_cli/action.yml +++ b/.github/actions/build_cli/action.yml @@ -49,7 +49,7 @@ runs: env: TARGET_GOOS: ${{ inputs.targetOS }} TARGET_GOARCH: ${{ inputs.targetArch }} - OUTPUT_PATH: ${{ inputs.outputPath || format('./build/constellation-{0}-{1}', inputs.targetOS, inputs.targetArch) }} + OUTPUT_PATH: ${{ inputs.outputPath || format('./build/constellation-{0}-{1}', inputs.targetOS, inputs.targetArch) }}${{ inputs.targetOS == 'windows' && '.exe' || '' }} run: | echo "::group::Build CLI" mkdir -p "$(dirname "${OUTPUT_PATH}")" @@ -100,7 +100,7 @@ runs: COSIGN_PUBLIC_KEY: ${{ inputs.cosignPublicKey }} COSIGN_PRIVATE_KEY: ${{ inputs.cosignPrivateKey }} COSIGN_PASSWORD: ${{ inputs.cosignPassword }} - OUTPUT_PATH: ${{ github.workspace }}/${{ inputs.outputPath || format('./build/constellation-{0}-{1}', inputs.targetOS, inputs.targetArch) }} + OUTPUT_PATH: ${{ github.workspace }}/${{ inputs.outputPath || format('./build/constellation-{0}-{1}', inputs.targetOS, inputs.targetArch) }}${{ inputs.targetOS == 'windows' && '.exe' || '' }} run: | echo "$COSIGN_PUBLIC_KEY" > cosign.pub # Enabling experimental mode also publishes signature to Rekor diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml index 0f35c7358..948122017 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/release-cli.yml @@ -46,8 +46,21 @@ jobs: strategy: fail-fast: false matrix: - arch: [amd64, arm64] - os: [linux, darwin] + include: + - arch: amd64 + os: linux + + - arch: amd64 + os: darwin + + - arch: amd64 + os: windows + + - arch: arm64 + os: linux + + - arch: arm64 + os: darwin steps: - name: Checkout id: checkout @@ -70,14 +83,24 @@ jobs: cosignPrivateKey: ${{ inputs.key == 'release' && secrets.COSIGN_PRIVATE_KEY || secrets.COSIGN_DEV_PRIVATE_KEY }} cosignPassword: ${{ inputs.key == 'release' && secrets.COSIGN_PASSWORD || secrets.COSIGN_DEV_PASSWORD }} - - name: Upload CLI as artifact + - name: Upload CLI as artifact (unix) uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + if : ${{ matrix.os != 'windows' }} with: name: constellation-${{ matrix.os }}-${{ matrix.arch }} path: | build/constellation-${{ matrix.os }}-${{ matrix.arch }} build/constellation-${{ matrix.os }}-${{ matrix.arch }}.sig + - name: Upload CLI as artifact (windows) + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + if : ${{ matrix.os == 'windows' }} + with: + name: constellation-${{ matrix.os }}-${{ matrix.arch }} + path: | + build/constellation-${{ matrix.os }}-${{ matrix.arch }}.exe + build/constellation-${{ matrix.os }}-${{ matrix.arch }}.exe.sig + push-containers: runs-on: ubuntu-22.04 if: inputs.pushContainers @@ -137,6 +160,11 @@ jobs: with: name: constellation-linux-arm64 + - name: Download CLI binaries windows-amd64 + uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 + with: + name: constellation-windows-amd64 + - name: Download CLI SBOM uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 with: @@ -150,6 +178,7 @@ jobs: constellation-darwin-arm64 \ constellation-linux-amd64 \ constellation-linux-arm64 \ + constellation-windows-amd64.exe \ constellation.spdx.sbom) HASHESB64=$(echo "${HASHES}" | base64 -w0) echo "${HASHES}" @@ -253,6 +282,11 @@ jobs: with: name: constellation-linux-arm64 + - name: Download CLI binaries windows-amd64 + uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 + with: + name: constellation-windows-amd64 + - name: Download CLI SBOM uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 with: @@ -282,6 +316,9 @@ jobs: slsa-verifier verify-artifact constellation-linux-arm64 \ --provenance-path ${{ needs.provenance.outputs.provenance-name }} \ --source-uri github.com/edgelesssys/constellation + slsa-verifier verify-artifact constellation-windows-amd64.exe \ + --provenance-path ${{ needs.provenance.outputs.provenance-name }} \ + --source-uri github.com/edgelesssys/constellation slsa-verifier verify-artifact constellation.spdx.sbom \ --provenance-path ${{ needs.provenance.outputs.provenance-name }} \ --source-uri github.com/edgelesssys/constellation @@ -320,6 +357,11 @@ jobs: with: name: constellation-linux-arm64 + - name: Download CLI binaries windows-amd64 + uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 + with: + name: constellation-windows-amd64 + - name: Download Constellation CLI SBOM uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 with: