Create Snapshot #26
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
name: Create Snapshot | |
on: | |
workflow_dispatch: | |
jobs: | |
create-snapshot-docker: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Get images | |
id: get-images | |
uses: trifork/cheetah-infrastructure-utils/.github/actions/docker/get-images@main | |
with: | |
image-name: cheetah-infrastructure-utils-kafka | |
TRIFORK_GITHUB_PAT: ${{ secrets.WRITE_PACKAGE_PAT }} | |
- name: Get version | |
id: get-version | |
run: echo version=$(grep -oP 'LABEL version="\K[^"]*' Dockerfile) >> $GITHUB_OUTPUT | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3 | |
- name: Get package suffix | |
id: get-package-suffix | |
run: echo "branch-name=$(echo '${{ github.ref_name }}' | sed 's/[^a-zA-Z0-9]/-/g')" >> $GITHUB_OUTPUT | |
- name: Build and push Docker image | |
id: build-image | |
uses: docker/build-push-action@31159d49c0d4756269a0940a750801a1ea5d7003 # v6 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
tags: ghcr.io/trifork/cheetah-infrastructure-utils-kafka:${{ steps.get-version.outputs.version }}-${{ steps.get-package-suffix.outputs.branch-name }}-SNAPSHOT-${{ github.run_number }} | |
push: true | |
create-snapshot-maven: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: "17" | |
distribution: "temurin" | |
cache: maven | |
- name: Get package suffix | |
id: get-package-suffix | |
run: echo "branch-name=$(echo '${{ github.ref_name }}' | sed 's/[^a-zA-Z0-9]/-/g')" >> $GITHUB_OUTPUT | |
- name: Set version suffix | |
shell: bash | |
run: mvn -q build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.qualifier}-${{ steps.get-package-suffix.outputs.branch-name }}-SNAPSHOT | |
- name: Publish Maven package | |
shell: bash | |
run: mvn deploy -P trifork -s settings.xml | |
env: | |
GITHUB_TOKEN: ${{ secrets.WRITE_PACKAGE_PAT }} |