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..67194f6f --- /dev/null +++ b/.github/workflows/add-release-info-to-pyxis.yml @@ -0,0 +1,53 @@ +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 + env: + CERT_FILE_LOCATION: /tmp/preflight-release.crt + KEY_FILE_LOCATION: /tmp/preflight-release.key + run: | + echo -en "${{ secrets.certificate }}" > $CERT_FILE_LOCATION + echo -en "${{ secrets.key }}" > $KEY_FILE_LOCATION + + - name: Call Pyxis API + run: | + curl -s \ + --cert '${{ env.CERT_FILE_LOCATION }}' \ + --key '${{ env.KEY_FILE_LOCATION }}' \ + --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 + + - name: Cleanup + if: always() + run: | + rm -f ${{ env.CERT_FILE_LOCATION }} ${{ env.KEY_FILE_LOCATION }} || true + + + diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 500a25ec..9bcf806f 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -13,7 +13,7 @@ env: jobs: build-release: name: Build and push tag images - strategy: + strategy: matrix: architecture: [amd64,ppc64le,arm64,s390x] platform: [linux] @@ -55,6 +55,8 @@ jobs: outputs: imageName: ${{ env.IMAGE_NAME }} imageVersion: ${{ env.RELEASE_TAG }} + commitSHA: ${{ github.sha }} + pyxisHost: ${{ vars.PYXIS_HOST }} build-multiarch: permissions: @@ -87,6 +89,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