feat: trigger release #19
Workflow file for this run
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: "tagged-release" | |
on: | |
push: | |
tags: | |
- "v*" | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: '21' | |
cache: 'maven' | |
- name: Build with Maven | |
run: mvn --batch-mode --update-snapshots verify | |
build-dist: | |
needs: tests | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: '21' | |
cache: 'maven' | |
- name: Build with Maven | |
run: mvn -B package --file pom.xml -Dmaven.test.skip # Tests are already run | |
- name: Tar files | |
run: tar -czvf kafka-connect-snmp-latest.tgz -C target/kafka-connect-target/ . | |
- name: Upload artifact | |
uses: actions/upload-artifact@v1 | |
with: | |
name: kafka-connect-snmp-latest.tgz | |
path: kafka-connect-snmp-latest.tgz | |
build-and-publish-image: | |
needs: build-dist | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@master | |
- name: Download the tarball | |
uses: actions/download-artifact@master | |
with: | |
name: kafka-connect-snmp-latest.tgz | |
- name: Create directory to extract to the tarball | |
run: mkdir -p kafka-connect-snmp | |
- name: Extract tarball | |
run: tar -xvzf kafka-connect-snmp-latest.tgz -C kafka-connect-snmp/ | |
- name: Log in to the Container registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v3 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |