123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- name: "Infra: Release"
- on:
- release:
- types: [published]
- jobs:
- release:
- runs-on: ubuntu-latest
- outputs:
- version: ${{steps.build.outputs.version}}
- steps:
- - uses: actions/checkout@v3
- with:
- fetch-depth: 0
- ref: ${{ github.event.pull_request.head.sha }}
- - run: |
- git config user.name github-actions
- git config user.email github-actions@github.com
- - name: Set up JDK
- uses: actions/setup-java@v3
- with:
- java-version: '17'
- distribution: 'zulu'
- cache: 'maven'
- - name: Build with Maven
- id: build
- run: |
- ./mvnw -B -ntp versions:set -DnewVersion=${{ github.event.release.tag_name }}
- ./mvnw -B -V -ntp clean package -Pprod -DskipTests
- export VERSION=$(./mvnw -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
- echo "version=${VERSION}" >> $GITHUB_OUTPUT
- - name: Upload files to a GitHub release
- uses: svenstaro/upload-release-action@2.7.0
- with:
- repo_token: ${{ secrets.GITHUB_TOKEN }}
- file: kafka-ui-api/target/kafka-ui-api-${{ steps.build.outputs.version }}.jar
- tag: ${{ github.event.release.tag_name }}
- - name: Archive JAR
- uses: actions/upload-artifact@v3
- with:
- name: kafka-ui-${{ steps.build.outputs.version }}
- path: kafka-ui-api/target/kafka-ui-api-${{ steps.build.outputs.version }}.jar
- #################
- # #
- # Docker images #
- # #
- #################
- - name: Set up QEMU
- uses: docker/setup-qemu-action@v2
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v2
- - name: Cache Docker layers
- uses: actions/cache@v3
- with:
- path: /tmp/.buildx-cache
- key: ${{ runner.os }}-buildx-${{ github.sha }}
- restore-keys: |
- ${{ runner.os }}-buildx-
- - name: Login to DockerHub
- uses: docker/login-action@v2
- with:
- username: ${{ secrets.DOCKERHUB_USERNAME }}
- password: ${{ secrets.DOCKERHUB_TOKEN }}
- - name: Build and push
- id: docker_build_and_push
- uses: docker/build-push-action@v4
- with:
- builder: ${{ steps.buildx.outputs.name }}
- context: kafka-ui-api
- platforms: linux/amd64,linux/arm64
- provenance: false
- push: true
- tags: |
- provectuslabs/kafka-ui:${{ steps.build.outputs.version }}
- provectuslabs/kafka-ui:latest
- build-args: |
- JAR_FILE=kafka-ui-api-${{ steps.build.outputs.version }}.jar
- cache-from: type=local,src=/tmp/.buildx-cache
- cache-to: type=local,dest=/tmp/.buildx-cache
- charts:
- runs-on: ubuntu-latest
- needs: release
- steps:
- - name: Repository Dispatch
- uses: peter-evans/repository-dispatch@v2
- with:
- token: ${{ secrets.CHARTS_ACTIONS_TOKEN }}
- repository: provectus/kafka-ui-charts
- event-type: prepare-helm-release
- client-payload: '{"appversion": "${{ needs.release.outputs.version }}"}'
|