From 98323270392ffde475d9e81b7505df0d5e91e0ca Mon Sep 17 00:00:00 2001 From: Ramin Gharib Date: Thu, 19 Dec 2024 16:09:32 +0100 Subject: [PATCH] Fix GitHub release workflow (#33) Depends on https://github.com/bakdata/ci-templates/pull/230 --- .github/workflows/build-and-publish.yaml | 37 +++++++++++++++++++----- .github/workflows/release.yaml | 2 +- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-and-publish.yaml b/.github/workflows/build-and-publish.yaml index b53bdb0..a741e3e 100644 --- a/.github/workflows/build-and-publish.yaml +++ b/.github/workflows/build-and-publish.yaml @@ -8,12 +8,15 @@ on: env: java-version: 21 gradle-version: 8.4 + gradle-cache: true + gradle-cache-read-only: true + gradle-refresh-dependencies: false working-directory: "./word-count/code" jobs: build-and-test: name: Build, Test and Assess code quality - uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@1.50.3 + uses: bakdata/ci-templates/.github/workflows/java-gradle-base.yaml@1.50.4 with: java-version: 21 gradle-version: 8.4 @@ -44,25 +47,43 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push sentence producer image - uses: bakdata/ci-templates/actions/java-gradle-build-jib@1.50.3 + uses: bakdata/ci-templates/actions/java-gradle-build-jib@1.50.4 with: full-image-name: bakdata/kpops-demo-sentence-producer class: com.bakdata.kpops.examples.SentenceProducer java-version: ${{ env.java-version }} gradle-version: ${{ env.gradle-version }} gradle-cache: true - gradle-cache-read-only: true - gradle-refresh-dependencies: false + gradle-cache-read-only: ${{ env.gradle-cache-read-only }} + gradle-refresh-dependencies: ${{ env.gradle-refresh-dependencies }} working-directory: ${{ env.working-directory }} - name: Build and push word count image - uses: bakdata/ci-templates/actions/java-gradle-build-jib@1.50.3 + uses: bakdata/ci-templates/actions/java-gradle-build-jib@1.50.4 with: full-image-name: bakdata/kpops-demo-word-count-app class: com.bakdata.kpops.examples.WordCountApplication java-version: ${{ env.java-version }} gradle-version: ${{ env.gradle-version }} - gradle-cache: true - gradle-cache-read-only: true - gradle-refresh-dependencies: false + gradle-cache: ${{ env.gradle-cache }} + gradle-cache-read-only: ${{ env.gradle-cache-read-only }} + gradle-refresh-dependencies: ${{ env.gradle-refresh-dependencies }} + working-directory: ${{ env.working-directory }} + + release: + name: Create Github release + if: startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-22.04 + needs: [build-and-test, build-jib] + + steps: + - name: Release on Github + uses: bakdata/ci-templates/actions/java-gradle-release-github@1.50.4 + with: + github-token: ${{ secrets.GH_TOKEN }} + java-version: ${{ env.java-version }} + gradle-version: ${{ env.gradle-version }} + gradle-cache: ${{ env.gradle-cache }} + gradle-cache-read-only: ${{ env.gradle-cache-read-only }} + gradle-refresh-dependencies: ${{ env.gradle-refresh-dependencies }} working-directory: ${{ env.working-directory }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 68e2dec..eb671bc 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -16,7 +16,7 @@ on: jobs: java-gradle-release: name: Java Gradle Release - uses: bakdata/ci-templates/.github/workflows/java-gradle-release.yaml@1.43.0 + uses: bakdata/ci-templates/.github/workflows/java-gradle-release.yaml@1.50.4 with: java-version: 21 release-type: "${{ inputs.release-type }}"