Skip to content

Commit

Permalink
adding new release action to send release information to pyxis
Browse files Browse the repository at this point in the history
Signed-off-by: Adam D. Cornett <[email protected]>
  • Loading branch information
acornett21 committed Apr 16, 2024
1 parent 0670106 commit b85fa4a
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 1 deletion.
53 changes: 53 additions & 0 deletions .github/workflows/add-release-info-to-pyxis.yml
Original file line number Diff line number Diff line change
@@ -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
17 changes: 16 additions & 1 deletion .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:
jobs:
build-release:
name: Build and push tag images
strategy:
strategy:
matrix:
architecture: [amd64,ppc64le,arm64,s390x]
platform: [linux]
Expand Down Expand Up @@ -55,6 +55,8 @@ jobs:
outputs:
imageName: ${{ env.IMAGE_NAME }}
imageVersion: ${{ env.RELEASE_TAG }}
commitSHA: ${{ github.sha }}
pyxisHost: ${{ vars.PYXIS_HOST }}

build-multiarch:
permissions:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b85fa4a

Please sign in to comment.