-
Notifications
You must be signed in to change notification settings - Fork 9
chore(inkless:release): add gh workflows to release inkless artifacts #489
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
4 commits
Select commit
Hold shift + click to select a range
5d59816
feat(ci): add GitHub workflows for Inkless releases
jeqo eec1436
docs(inkless): add releases documentation
jeqo 7b5e551
fixup! feat(ci): add GitHub workflows for Inkless releases
jeqo 38263d3
fixup! docs(inkless): add releases documentation
jeqo 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 |
|---|---|---|
| @@ -0,0 +1,153 @@ | ||
| # Copyright (c) 2025 Aiven, Helsinki, Finland. https://aiven.io/ | ||
| # Workflow for building and publishing Inkless edge (development) images to GHCR | ||
| # Uses native runners for each architecture for faster builds | ||
|
|
||
| name: Inkless Edge | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| push_image: | ||
| description: 'Push image to GHCR' | ||
| type: boolean | ||
| default: true | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| concurrency: | ||
| group: inkless-edge-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| REGISTRY: ghcr.io | ||
| IMAGE_NAME: ghcr.io/aiven/inkless | ||
|
|
||
| jobs: | ||
| # Determine the image tags | ||
| prepare: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| edge_tag: ${{ 'edge' }} | ||
| sha_tag: ${{ steps.sha-tag.outputs.tag }} | ||
| steps: | ||
| - name: Determine SHA tag | ||
| id: sha-tag | ||
| env: | ||
| GITHUB_SHA: ${{ github.sha }} | ||
| run: | | ||
| SHORT_SHA=$(echo "$GITHUB_SHA" | cut -c1-7) | ||
| echo "tag=edge-${SHORT_SHA}" >> $GITHUB_OUTPUT | ||
|
|
||
| # Build on each architecture using native runners | ||
| # TODO: Kafka distribution is arch-independent but rebuilds on each runner. | ||
| # Could build once and share via artifacts to reduce build time. | ||
| build: | ||
| needs: prepare | ||
| runs-on: ${{ matrix.runner }} | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - arch: amd64 | ||
| runner: ubuntu-latest | ||
| - arch: arm64 | ||
| runner: ubuntu-24.04-arm | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Setup Gradle | ||
| uses: ./.github/actions/setup-gradle | ||
| with: | ||
| java-version: 17 | ||
| gradle-cache-read-only: false | ||
|
|
||
| - name: Build Kafka distribution | ||
| run: make build_release | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Login to GitHub Container Registry | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ${{ env.REGISTRY }} | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Build and push architecture-specific image | ||
| env: | ||
| ARCH: ${{ matrix.arch }} | ||
| EDGE_TAG: ${{ needs.prepare.outputs.edge_tag }} | ||
| SHA_TAG: ${{ needs.prepare.outputs.sha_tag }} | ||
| SHOULD_PUSH: ${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.push_image) }} | ||
| BUILD_TIMESTAMP: ${{ github.event.head_commit.timestamp }} | ||
| run: | | ||
| make docker_build \ | ||
| PLATFORM="linux/${ARCH}" \ | ||
| DOCKER_TAGS="${IMAGE_NAME}:${EDGE_TAG}-${ARCH} ${IMAGE_NAME}:${SHA_TAG}-${ARCH}" \ | ||
| PUSH="${SHOULD_PUSH}" \ | ||
| BUILD_DATE="${BUILD_TIMESTAMP}" \ | ||
| CACHE_FROM="type=gha,scope=${ARCH}" \ | ||
| CACHE_TO="type=gha,mode=max,scope=${ARCH}" | ||
|
|
||
| # Create multi-arch manifests | ||
| manifest: | ||
| needs: [prepare, build] | ||
| if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.push_image) | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| packages: write | ||
|
|
||
| steps: | ||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Login to GitHub Container Registry | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ${{ env.REGISTRY }} | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Create and push edge manifest | ||
| run: | | ||
| docker buildx imagetools create -t ${{ env.IMAGE_NAME }}:edge \ | ||
| ${{ env.IMAGE_NAME }}:edge-amd64 \ | ||
| ${{ env.IMAGE_NAME }}:edge-arm64 | ||
|
jeqo marked this conversation as resolved.
|
||
|
|
||
| - name: Create and push SHA manifest | ||
| env: | ||
| SHA_TAG: ${{ needs.prepare.outputs.sha_tag }} | ||
| run: | | ||
| docker buildx imagetools create -t "${IMAGE_NAME}:${SHA_TAG}" \ | ||
| "${IMAGE_NAME}:${SHA_TAG}-amd64" \ | ||
| "${IMAGE_NAME}:${SHA_TAG}-arm64" | ||
|
|
||
| - name: Inspect manifest | ||
| run: | | ||
| docker buildx imagetools inspect ${{ env.IMAGE_NAME }}:edge | ||
|
|
||
| - name: Output image details | ||
| run: | | ||
| echo "## Edge Docker Image Published" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "**Images:**" >> $GITHUB_STEP_SUMMARY | ||
| echo "- \`${{ env.IMAGE_NAME }}:edge\`" >> $GITHUB_STEP_SUMMARY | ||
| echo "- \`${{ env.IMAGE_NAME }}:${{ needs.prepare.outputs.sha_tag }}\`" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "**Platforms:** linux/amd64, linux/arm64" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "### Pull Command" >> $GITHUB_STEP_SUMMARY | ||
| echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY | ||
| echo "docker pull ${{ env.IMAGE_NAME }}:edge" >> $GITHUB_STEP_SUMMARY | ||
| echo "# or for this specific commit:" >> $GITHUB_STEP_SUMMARY | ||
| echo "docker pull ${{ env.IMAGE_NAME }}:${{ needs.prepare.outputs.sha_tag }}" >> $GITHUB_STEP_SUMMARY | ||
| echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | ||
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.
Uh oh!
There was an error while loading. Please reload this page.