diff --git a/.github/workflows/add-release-info-to-pyxis.yml b/.github/workflows/add-release-info-to-pyxis.yml new file mode 100644 index 00000000..7345850a --- /dev/null +++ b/.github/workflows/add-release-info-to-pyxis.yml @@ -0,0 +1,42 @@ +name: Add Release Info to Pyxis + +on: + workflow_call: + inputs: + tag: + required: true + type: string + commit: + required: true + type: string + host: + required: true + type: string + secrets: + certificate: + required: true + key: + required: true + certificatePassword: + required: true + +jobs: + call-pyxis-endpoint: + name: Add Release Info + runs-on: ubuntu-latest + steps: + - name: Save Certificate and Key + run: | + echo -en "${{ secrets.certificate }}" > /tmp/preflight-release.crt + echo -en "${{ secrets.key }}" > /tmp/preflight-release.key + + - name: Call Pyxis API + run: | + curl -s \ + --cert '/tmp/preflight-release.crt \ + --key '/tmp/preflight-release.key' \ + --pass '${{ secrets.certificatePassword }}' \ + -H 'Content-Type: application/json' \ + -d '{"commit":"${{ inputs.commit }}","enabled_for_testing":true,"name":"github.com/redhat-openshift-ecosystem/openshift-preflight","version":"${{ inputs.tag }}"}' \ + -X POST \ + 'https://${{ inputs.host }}/v1/tools' | jq diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 500a25ec..23591075 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -13,16 +13,19 @@ env: jobs: build-release: name: Build and push tag images - strategy: + strategy: matrix: architecture: [amd64,ppc64le,arm64,s390x] platform: [linux] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set Env Tags + - name: Set Release Tag run: echo RELEASE_TAG=$(echo $GITHUB_REF | cut -d '/' -f 3) >> $GITHUB_ENV + - name: Set COMMIT_SHA/Version + run: echo COMMIT_SHA=$(git rev-parse HEAD) >> $GITHUB_ENV + - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -55,6 +58,8 @@ jobs: outputs: imageName: ${{ env.IMAGE_NAME }} imageVersion: ${{ env.RELEASE_TAG }} + commitSHA: ${{ env.COMMIT_SHA }} + pyxisHost: ${{ vars.PYXIS_HOST }} build-multiarch: permissions: @@ -87,6 +92,19 @@ jobs: password: ${{ secrets.REGISTRY_PASSWORD }} token: ${{ secrets.GITHUB_TOKEN }} + add-release-info-to-pyxis: + needs: [build-release, extract-assets] + uses: ./.github/workflows/add-release-info-to-pyxis.yml + if: "!github.event.release.prerelease" + with: + tag: ${{ needs.build-release.outputs.imageVersion }} + commit: ${{ needs.build-release.outputs.commitSHA }} + host: ${{ needs.build-release.outputs.pyxisHost }} + secrets: + certificate: ${{ secrets.PREFLIGHT_RELEASE_CERTIFICATE }} + key: ${{ secrets.PREFLIGHT_RELEASE_KEY }} + certificatePassword: ${{ secrets.PREFLIGHT_RELEASE_PASSWORD }} + copy-to-rhisv: needs: [build-release, build-multiarch] uses: ./.github/workflows/copy-to-rhisv.yml