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 10, 2024
1 parent 0670106 commit e8a7e34
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 2 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/add-release-info-to-pyxis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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
# enabled:
# required: true
# type: boolean
secrets:
certificate:
required: true
certificatePassword:
required: true

jobs:
call-pyxis-endpoint:
name: Add Release Info
runs-on: ubuntu-latest
steps:
- name: Save Certificate
run: |
printf ${{ secrets.certificate }} >> certificate.pem
- name: Call Pyxis API
run: |
curl --cert 'certificate.pem:${{ secrets.certificatePassword }}' \
-H 'Content-Type: application/json' \
-d '{"commit":"${{ inputs.commit }}","enabled_for_testing":false,"name":"github.com/redhat-openshift-ecosystem/openshift-preflight","version":"${{ inputs.tag }}"}' \
-X POST \
https://${{ inputs.host }}/v1/tools
23 changes: 21 additions & 2 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 Version
run: echo COMMIT_SHA=$(git rev-parse HEAD) >> $GITHUB_ENV

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

Expand Down Expand Up @@ -55,6 +58,9 @@ jobs:
outputs:
imageName: ${{ env.IMAGE_NAME }}
imageVersion: ${{ env.RELEASE_TAG }}
commitSHA: ${{ env.COMMIT_SHA }}
pyxisHost: ${{ vars.PYXIS_HOST }}
#enabled: ${{ env.PYXIS_RELEASE_ENABLED }}

build-multiarch:
permissions:
Expand Down Expand Up @@ -87,6 +93,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 }}
#enabled: ${{ needs.build-release.outputs.enabled }}
secrets:
certificate: $${{ secrets.PREFLIGHT_RELEASE_CERTIFICATE }}
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 e8a7e34

Please sign in to comment.