-
Notifications
You must be signed in to change notification settings - Fork 15
Conditional krew index PR and multiarch binary server #85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
eb0ad2a
Exclude prerelease versions from krew release bot PRs
Joeavaikath d74548e
quay oadp-cli-binaries push multiarch
Joeavaikath bb4234e
Use buildah multi arch
Joeavaikath 8a1329e
Buildah action
Joeavaikath 6031de6
test tag for PRs
Joeavaikath 34a6175
Fix image tags for inspect
Joeavaikath 1c86f89
Multiarch amd and arm
Joeavaikath 6e19434
Fix
Joeavaikath bc65059
Add back archs
Joeavaikath 5998e93
Matrix strat
Joeavaikath 197f503
multi-platform Containerfile and remove QEMU
Joeavaikath f7076ac
Test quay.io push
Joeavaikath a6ced69
Reference by id after buildah pull
Joeavaikath c66d72c
Revert to konveyor
Joeavaikath File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,30 +1,98 @@ | ||
| # Push binaries to Quay.io, when a new release is created | ||
| name: oadp-cli binaries image push | ||
| name: Multi-Arch Binary Push to Quay.io | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - 'v*' | ||
| pull_request: | ||
|
|
||
|
|
||
| env: | ||
| IMAGE_REPO: quay.io/konveyor/oadp-cli-binaries | ||
|
|
||
| # Check out code, podman login, run podman build, push to | ||
| jobs: | ||
| push-binaries: | ||
|
|
||
| multi-arch-build: | ||
| name: Build Multi-Arch Images | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| arch: [amd64, arm64, ppc64le, s390x] | ||
| steps: | ||
|
|
||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Podman login | ||
| run: podman login -u ${{ secrets.QUAY_USER }} -p ${{ secrets.QUAY_TOKEN }} quay.io | ||
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version-file: go.mod | ||
| cache: true | ||
|
|
||
| - name: Build Image for ${{ matrix.arch }} | ||
| id: build_image | ||
| uses: redhat-actions/buildah-build@v2 | ||
| with: | ||
| image: oadp-cli-binaries-local | ||
| tags: ${{ matrix.arch }} | ||
| archs: ${{ matrix.arch }} | ||
| containerfiles: | | ||
| ./Containerfile.download | ||
|
|
||
| - name: Podman build and tag | ||
| - name: Save image as tar | ||
| run: | | ||
| podman build -f Dockerfile.download \ | ||
| -t quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }} \ | ||
| -t quay.io/konveyor/oadp-cli-binaries:latest . | ||
|
|
||
| - name: Podman push version tag | ||
| run: podman push quay.io/konveyor/oadp-cli-binaries:${{ github.ref_name }} | ||
| buildah push ${{ steps.build_image.outputs.image-with-tag }} oci-archive:oadp-cli-${{ matrix.arch }}.tar | ||
|
|
||
| - name: Upload image artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: oadp-cli-image-${{ matrix.arch }} | ||
| path: oadp-cli-${{ matrix.arch }}.tar | ||
| retention-days: 1 | ||
|
|
||
| push-manifest: | ||
| name: Create and Push Multi-Arch Manifest | ||
| runs-on: ubuntu-latest | ||
| needs: multi-arch-build | ||
| if: startsWith(github.ref_name, 'v') | ||
| steps: | ||
| - name: Download all artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| pattern: oadp-cli-image-* | ||
|
|
||
| - name: Podman push latest tag | ||
| run: podman push quay.io/konveyor/oadp-cli-binaries:latest | ||
| - name: Buildah login | ||
| run: buildah login -u ${{ secrets.QUAY_USER }} -p ${{ secrets.QUAY_TOKEN }} quay.io | ||
|
|
||
| - name: Load images and tag archs | ||
| run: | | ||
| # Load all arch images and capture their IDs | ||
| AMD64_ID=$(buildah pull oci-archive:oadp-cli-image-amd64/oadp-cli-amd64.tar) | ||
| ARM64_ID=$(buildah pull oci-archive:oadp-cli-image-arm64/oadp-cli-arm64.tar) | ||
| PPC64LE_ID=$(buildah pull oci-archive:oadp-cli-image-ppc64le/oadp-cli-ppc64le.tar) | ||
| S390X_ID=$(buildah pull oci-archive:oadp-cli-image-s390x/oadp-cli-s390x.tar) | ||
|
|
||
| # Tag the loaded images using their IDs | ||
| buildah tag $AMD64_ID ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-amd64 | ||
| buildah tag $ARM64_ID ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-arm64 | ||
| buildah tag $PPC64LE_ID ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-ppc64le | ||
| buildah tag $S390X_ID ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-s390x | ||
|
|
||
| - name: Create and push multi-arch manifest (version tag) | ||
| run: | | ||
| buildah manifest create ${{ env.IMAGE_REPO }}:${{ github.ref_name }} | ||
| buildah manifest add ${{ env.IMAGE_REPO }}:${{ github.ref_name }} ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-amd64 | ||
| buildah manifest add ${{ env.IMAGE_REPO }}:${{ github.ref_name }} ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-arm64 | ||
| buildah manifest add ${{ env.IMAGE_REPO }}:${{ github.ref_name }} ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-ppc64le | ||
| buildah manifest add ${{ env.IMAGE_REPO }}:${{ github.ref_name }} ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-s390x | ||
| buildah manifest push --all ${{ env.IMAGE_REPO }}:${{ github.ref_name }} | ||
|
|
||
| - name: Create and push multi-arch manifest (latest tag) | ||
| run: | | ||
| buildah manifest create ${{ env.IMAGE_REPO }}:latest | ||
| buildah manifest add ${{ env.IMAGE_REPO }}:latest ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-amd64 | ||
| buildah manifest add ${{ env.IMAGE_REPO }}:latest ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-arm64 | ||
| buildah manifest add ${{ env.IMAGE_REPO }}:latest ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-ppc64le | ||
| buildah manifest add ${{ env.IMAGE_REPO }}:latest ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-s390x | ||
| buildah manifest push --all ${{ env.IMAGE_REPO }}:latest |
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make this run on pull request but not push if pull request?