crc-builder-pusher #90
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: crc-builder-pusher | |
on: | |
workflow_run: | |
workflows: [ 'crc-builder-builder' ] | |
types: | |
- completed | |
jobs: | |
push: | |
name: push | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
runs-on: ubuntu-24.04 | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Download crc-builder assets | |
uses: actions/download-artifact@v4 | |
with: | |
name: crc-builder | |
run-id: ${{ github.event.workflow_run.id }} | |
github-token: ${{ github.token }} | |
- name: Get crc-builder build informaiton | |
run: | | |
echo "source_event=$(cat crc-builder-build-event)" >> "$GITHUB_ENV" | |
echo "image=$(cat crc-builder-image)" >> "$GITHUB_ENV" | |
- name: Log in to ghcr.io | |
if: ${{ env.source_event == 'pull_request' }} | |
uses: redhat-actions/podman-login@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Log in quay.io | |
if: ${{ env.source_event == 'push' }} | |
uses: redhat-actions/podman-login@v1 | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_IO_USERNAME }} | |
password: ${{ secrets.QUAY_IO_PASSWORD }} | |
- name: Push crc-builder | |
run: | | |
# Load | |
podman load -i crc-builder-linux-arm64.tar | |
podman load -i crc-builder-linux-amd64.tar | |
podman load -i crc-builder-windows.tar | |
podman load -i crc-builder-darwin.tar | |
# Push | |
podman push ${{ env.image }}-linux-arm64 | |
podman push ${{ env.image }}-linux-amd64 | |
podman manifest create ${{ env.image }}-linux | |
podman manifest add ${{ env.image }}-linux docker://${{ env.image }}-linux-arm64 | |
podman manifest add ${{ env.image }}-linux docker://${{ env.image }}-linux-amd64 | |
podman manifest push --all ${{ env.image }}-linux | |
podman push ${{ env.image }}-windows | |
podman push ${{ env.image }}-darwin | |
- name: Download crc-builder-tkn assets | |
uses: actions/download-artifact@v4 | |
with: | |
name: crc-builder-tkn | |
run-id: ${{ github.event.workflow_run.id }} | |
github-token: ${{ github.token }} | |
- name: Push crc-builder-tkn | |
env: | |
TKN_VERSION: '0.37.0' | |
run: | | |
curl -LO "https://github.com/tektoncd/cli/releases/download/v${TKN_VERSION}/tkn_${TKN_VERSION}_Linux_x86_64.tar.gz" | |
tar xvzf "tkn_${TKN_VERSION}_Linux_x86_64.tar.gz" tkn | |
./tkn bundle push ${{ env.image }}-tkn \ | |
-f crc-builder-installer.yaml \ | |
-f crc-builder.yaml | |