Skip to content

Publish

Publish #32

Workflow file for this run

name: Publish
on:
workflow_dispatch:
inputs:
version:
description: 'Define version to be built and tested (example: "1.13.4")'
required: true
jobs:
set-olm-tag:
runs-on: ubuntu-20.04
outputs:
olm-tag: ${{ steps.set.outputs.OLM_TAG }}
steps:
- uses: actions/checkout@v1
- id: set
name: Set OLM Tag
run: |
VERSION="${{ github.event.inputs.version }}"
set -o pipefail
olm_tag=$(yq .spec.install.spec.deployments[0].spec.template.spec.containers[0].image bundles/cilium.v${VERSION#v}/manifests/cilium.clusterserviceversion.yaml | cut -d ':' -f 2)
echo "::set-output name=OLM_TAG::${olm_tag}"
build-and-publish:
if: needs.set-olm-tag.outputs.olm-tag != ''
env:
PREFLIGHT_VERSION: 1.2.1
OLM_TAG: ${{ needs.set-olm-tag.outputs.olm-tag }}
name: Build Images and Validate Images
runs-on: ubuntu-20.04
needs: set-olm-tag
steps:
- uses: actions/checkout@v1
- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 #v3.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 #v3.0.0
- name: Login to scan.connect.redhat.com
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d #v3.0.0
with:
registry: quay.io
username: redhat-isv-containers+5fbe31ec8b7d4976604cbde0-robot
password: ${{ secrets.RHCP_OLM_REGISTRY_PASSWORD }}
- name: Push to Quay.io
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 #v5.0.0
with:
provenance: false
context: ./operator/cilium.v${{ github.event.inputs.version }}/
push: true
tags: quay.io/redhat-isv-containers/5fbe31ec8b7d4976604cbde0:${{ env.OLM_TAG }}
- name: Install Preflight
run: |
curl -L https://github.com/redhat-openshift-ecosystem/openshift-preflight/releases/download/${{ env.PREFLIGHT_VERSION }}/preflight-linux-amd64 -o preflight-linux-amd64
sha256sum --check .github_workflow_assets/preflight-linux-amd64.sha256sum
sudo chmod +x preflight-linux-amd64
sudo mv preflight-linux-amd64 /usr/local/bin/preflight
- name: Run Preflight
run: |
ls ~/.docker
cat ~/.docker/config.json
preflight check container \
--pyxis-api-token=${{ secrets.RHCP_PREFLIGHT_API_KEY }} \
-d ~/.docker/config.json \
--submit \
--certification-project-id=5fbe31ec8b7d4976604cbde0 \
quay.io/redhat-isv-containers/5fbe31ec8b7d4976604cbde0:${{ env.OLM_TAG }}