task: add tests and move DB conditions into a single util (#47) #63
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Multiple Architecture Image Build | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- "main" | |
- "release-*" | |
tags: | |
- "v*" | |
concurrency: | |
group: build-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
prepare: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Extract tag | |
id: extract_tag | |
run: | | |
tag=$(if [[ ${{github.ref_name}} == v* ]];then echo "${{github.ref_name}}"; else echo "latest"; fi) | |
echo "tag=$tag" >> $GITHUB_OUTPUT | |
outputs: | |
tag: ${{ steps.extract_tag.outputs.tag }} | |
operator-build: | |
uses: trustification/release-tools/.github/workflows/build-push-images.yaml@main | |
with: | |
registry: "ghcr.io" | |
image_name: "${{ github.repository_owner }}/trustify-operator" | |
containerfile: "./Dockerfile" | |
architectures: '[ "amd64", "arm64" ]' | |
secrets: | |
registry_username: ${{ github.actor }} | |
registry_password: ${{ secrets.GITHUB_TOKEN }} | |
bundle-build: | |
uses: trustification/release-tools/.github/workflows/build-push-images.yaml@main | |
needs: | |
- prepare | |
- operator-build | |
with: | |
registry: "ghcr.io" | |
image_name: "${{ github.repository_owner }}/trustify-operator-bundle" | |
containerfile: "./bundle.Dockerfile" | |
architectures: '[ "amd64", "arm64" ]' | |
extra-args: '--build-arg QUARKUS_OPTS="-Dquarkus.container-image.image=ghcr.io/${{ github.repository_owner }}/trustify-operator:${{ needs.prepare.outputs.tag }}"' | |
secrets: | |
registry_username: ${{ github.actor }} | |
registry_password: ${{ secrets.GITHUB_TOKEN }} | |
catalog-build: | |
runs-on: ubuntu-latest | |
needs: | |
- prepare | |
- bundle-build | |
steps: | |
- name: Setup OLM CLIs | |
run: | | |
export ARCH=$(case $(uname -m) in x86_64) echo -n amd64 ;; aarch64) echo -n arm64 ;; *) echo -n $(uname -m) ;; esac) | |
export OS=$(uname | awk '{print tolower($0)}') | |
# Opm | |
export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-registry/releases/download/v1.45.0 | |
curl -LO ${OPERATOR_SDK_DL_URL}/${OS}-${ARCH}-opm | |
chmod +x ${OS}-${ARCH}-opm && sudo mv ${OS}-${ARCH}-opm /usr/local/bin/opm | |
- name: Create catalog | |
run: | | |
opm index add \ | |
--bundles ghcr.io/${{ github.repository_owner }}/trustify-operator-bundle:$TAG \ | |
--tag ${{ github.repository_owner }}/trustify-operator-catalog:$TAG \ | |
--build-tool podman | |
env: | |
TAG: ${{ needs.prepare.outputs.tag }} | |
- name: Push To Registry | |
uses: redhat-actions/push-to-registry@v2 | |
with: | |
image: ${{ github.repository_owner }}/trustify-operator-catalog | |
tags: ${{ needs.prepare.outputs.tag }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
registry: "ghcr.io" |