From 06d0a6eb897bd76a3a4e769cb006849d35db5c98 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Thu, 21 Sep 2023 17:43:50 +0200 Subject: [PATCH 01/27] Initial commit --- .github/workflows/java-gradle-release.yaml | 24 ++--- actions/java-gradle-build/action.yaml | 100 ++++++++++++++++----- 2 files changed, 90 insertions(+), 34 deletions(-) diff --git a/.github/workflows/java-gradle-release.yaml b/.github/workflows/java-gradle-release.yaml index 96261bc4b..b4afbdeba 100644 --- a/.github/workflows/java-gradle-release.yaml +++ b/.github/workflows/java-gradle-release.yaml @@ -8,6 +8,17 @@ on: description: "Scope of the release (major, minor or patch)." required: true type: string + + gradle-cache: + description: "Whether Gradle caching is enabled or not. (Default is true)" + required: false + default: true + type: boolean + gradle-version: + description: "Gradle version to be installed. (Default is wrapper)" + required: false + type: string + default: "wrapper" java-distribution: description: "Java distribution to be installed. (Default is microsoft)" required: false @@ -18,16 +29,6 @@ on: required: false type: string default: "11" - gradle-version: - description: "Gradle version to be installed. (Default is wrapper)" - required: false - type: string - default: "wrapper" - gradle-cache: - description: "Whether Gradle caching is enabled or not. (Default is true)" - required: false - type: boolean - default: true working-directory: description: "Working directory of your Gradle artifacts. (Default is .)" required: false @@ -62,7 +63,8 @@ jobs: steps: - name: Release on Github id: release - uses: bakdata/ci-templates/actions/java-gradle-release@1.27.0 + uses: bakdata/ci-templates/actions/java-gradle-release@feat/gradle-release + # uses: bakdata/ci-templates/actions/java-gradle-release@1.35.0 with: release-type: ${{ inputs.release-type }} github-email: ${{ secrets.github-email }} diff --git a/actions/java-gradle-build/action.yaml b/actions/java-gradle-build/action.yaml index d95d77a11..bacb400c0 100644 --- a/actions/java-gradle-build/action.yaml +++ b/actions/java-gradle-build/action.yaml @@ -1,11 +1,32 @@ -name: "Build Java artifacts" -description: "Build Java artifacts using Gradle" +name: "Release Java artifacts" +description: "Release Java Gradle artifacts on Github" inputs: - build-artifact-name: - description: "Artifact name that is used for uploading build artifacts, see https://github.com/actions/upload-artifact (Default is build-artifact)." + github-email: + description: "GitHub email for requesting changes from API." + required: true + github-token: + description: "GitHub token for requesting changes from API." + required: true + github-username: + description: "GitHub username for requesting changes from API." + required: true + release-type: + description: "Scope of the release" + required: true + + changelog-file: + description: "Path to the changelog file" + required: false + default: "CHANGELOG.md" + gradle-cache: + description: "Whether Gradle caching is enabled or not. (Default is true)" + required: false + default: true + gradle-version: + description: "Gradle version to be installed. (Default is wrapper)" required: false - default: "build-artifact" + default: "wrapper" java-distribution: description: "Java distribution to be installed. (Default is microsoft)" required: false @@ -14,23 +35,36 @@ inputs: description: "Java version to be installed. (Default is 11)" required: false default: "11" - gradle-version: - description: "Gradle version to be installed. (Default is wrapper)" - required: false - default: "wrapper" - gradle-cache: - description: "Whether Gradle caching is enabled or not. (Default is true)" - required: false - default: true working-directory: description: "Working directory of your Gradle artifacts. (Default is .)" required: false default: "." + +outputs: + release-version: + description: "The bumped version of your release." + value: ${{ steps.evaluate-version.outputs.release-version }} + runs: using: "composite" steps: - name: Check out repository uses: bakdata/ci-templates/actions/checkout@1.32.0 + with: + fetch-depth: 0 + token: ${{ inputs.github-token }} + + - name: Setup git + run: | + git config user.email ${{ inputs.github-email }} + git config user.name ${{ inputs.github-username }} + shell: bash + + - name: Setup semver + run: | + wget -O /usr/local/bin/semver https://raw.githubusercontent.com/fsaintjacques/semver-tool/3.3.0/src/semver + chmod +x /usr/local/bin/semver + shell: bash - name: Set up Gradle with version ${{ inputs.gradle-version }} uses: bakdata/ci-templates/actions/java-gradle-setup@v1.16.0 @@ -40,19 +74,39 @@ runs: gradle-version: ${{ inputs.gradle-version }} gradle-cache: ${{ inputs.gradle-cache }} - - name: Compile - run: ./gradlew --info --stacktrace build -x test + - name: Bump version + id: evaluate-version + run: | + old_version=$(./gradlew properties -q | grep "^version:" | awk '{print $2}' | tr -d '[:space:]' | xargs) + if [[ "${{ inputs.release-type }}" == "patch" ]]; then + release_version="${old_version%-*}" + else + release_version=$(semver bump "${{ inputs.release-type }}" "${old_version}") + fi + echo "release-version=$release_version" >> "$GITHUB_OUTPUT" shell: bash - working-directory: ${{ inputs.working-directory }} - - name: Build jar - run: ./gradlew --info --stacktrace jar + - name: Create release + run: ./gradlew release -x test -Prelease.useAutomaticVersion=true -Prelease.releaseVersion=${{ steps.evaluate-version.outputs.release-version }} -PdisablePushToRemote=true shell: bash working-directory: ${{ inputs.working-directory }} - - name: Upload build artifact - uses: actions/upload-artifact@v3 + - name: Create changelog + id: build-changelog + uses: bakdata/ci-templates/actions/changelog-generate@feat/gradle-release + # uses: bakdata/ci-templates/actions/changelog-generate@1.35.0 + with: + github-token: ${{ inputs.github-token }} + new-tag: ${{ steps.evaluate-version.outputs.release-version }} + changelog-file: "${{ inputs.changelog-file }}" + fetch-reviewers: "true" + fetch-release-information: "true" + + - name: Commit and push changes including .bumpversion.cfg file + uses: bakdata/ci-templates/actions/commit-and-push@1.32.0 with: - name: ${{ inputs.build-artifact-name }} - path: ${{ inputs.working-directory }}/**/build/libs/*.jar - retention-days: 1 + ref: ${{ github.event.repository.default_branch }} + commit-message: "Bump version ${{ steps.bump-version.outputs.old-version }} → ${{ steps.bump-version.outputs.release-version }}" + github-username: ${{ inputs.github-username }} + github-email: ${{ inputs.github-email }} + github-token: ${{ inputs.github-token }} From 57854f77e926480a2d4c4e0ebbe598eb0353750d Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Thu, 21 Sep 2023 19:22:34 +0200 Subject: [PATCH 02/27] Update changelog generation --- actions/java-gradle-release/action.yaml | 34 ++++++++++++++----------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/actions/java-gradle-release/action.yaml b/actions/java-gradle-release/action.yaml index a522eeefb..e720ca6cd 100644 --- a/actions/java-gradle-release/action.yaml +++ b/actions/java-gradle-release/action.yaml @@ -60,7 +60,7 @@ runs: wget -O /usr/local/bin/semver https://raw.githubusercontent.com/fsaintjacques/semver-tool/3.3.0/src/semver chmod +x /usr/local/bin/semver shell: bash - + - name: Set up Gradle with version ${{ inputs.gradle-version }} uses: bakdata/ci-templates/actions/java-gradle-setup@v1.16.0 with: @@ -84,19 +84,23 @@ runs: - name: Create release run: ./gradlew release -x test -Prelease.useAutomaticVersion=true -Prelease.releaseVersion=${{ steps.evaluate-version.outputs.release-version }} -PdisablePushToRemote=true shell: bash - working-directory: ${{ inputs.working-directory }} - - - name: Generate changelog - run: ./gradlew -Pchangelog.releaseVersion=${{ steps.evaluate-version.outputs.release-version }} --stacktrace --info generateChangelog - shell: bash working-directory: ${{ inputs.working-directory }} - env: - GITHUB_USER: ${{ inputs.github-username }} - GITHUB_TOKEN: ${{ inputs.github-token }} - - name: Commit and push - run: | - git add CHANGELOG.md - git commit -m "Changelog for version ${{ steps.evaluate-version.outputs.release-version }}" - git push --follow-tags origin ${{ github.event.repository.default_branch }} - shell: bash + - name: Create changelog + id: build-changelog + uses: bakdata/ci-templates/actions/changelog-generate@1.33.0 + with: + github-token: ${{ inputs.github-token }} + new-tag: ${{ steps.evaluate-version.outputs.release-version }} + changelog-file: "${{ inputs.changelog-file }}" + fetch-reviewers: "true" + fetch-release-information: "true" + + - name: Commit and push changes including .bumpversion.cfg file + uses: bakdata/ci-templates/actions/commit-and-push@1.32.0 + with: + ref: ${{ github.event.repository.default_branch }} + commit-message: "Changelog for version ${{ steps.evaluate-version.outputs.release-version }}" + github-username: ${{ inputs.github-username }} + github-email: ${{ inputs.github-email }} + github-token: ${{ inputs.github-token }} From 19cb784ce604306fe7eca4fc6717e61659429c27 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Fri, 22 Sep 2023 10:13:49 +0200 Subject: [PATCH 03/27] Clean code and revert changes in the build action --- actions/java-gradle-build/action.yaml | 100 ++++++------------------ actions/java-gradle-release/action.yaml | 2 +- 2 files changed, 24 insertions(+), 78 deletions(-) diff --git a/actions/java-gradle-build/action.yaml b/actions/java-gradle-build/action.yaml index bacb400c0..d95d77a11 100644 --- a/actions/java-gradle-build/action.yaml +++ b/actions/java-gradle-build/action.yaml @@ -1,32 +1,11 @@ -name: "Release Java artifacts" -description: "Release Java Gradle artifacts on Github" +name: "Build Java artifacts" +description: "Build Java artifacts using Gradle" inputs: - github-email: - description: "GitHub email for requesting changes from API." - required: true - github-token: - description: "GitHub token for requesting changes from API." - required: true - github-username: - description: "GitHub username for requesting changes from API." - required: true - release-type: - description: "Scope of the release" - required: true - - changelog-file: - description: "Path to the changelog file" - required: false - default: "CHANGELOG.md" - gradle-cache: - description: "Whether Gradle caching is enabled or not. (Default is true)" - required: false - default: true - gradle-version: - description: "Gradle version to be installed. (Default is wrapper)" + build-artifact-name: + description: "Artifact name that is used for uploading build artifacts, see https://github.com/actions/upload-artifact (Default is build-artifact)." required: false - default: "wrapper" + default: "build-artifact" java-distribution: description: "Java distribution to be installed. (Default is microsoft)" required: false @@ -35,36 +14,23 @@ inputs: description: "Java version to be installed. (Default is 11)" required: false default: "11" + gradle-version: + description: "Gradle version to be installed. (Default is wrapper)" + required: false + default: "wrapper" + gradle-cache: + description: "Whether Gradle caching is enabled or not. (Default is true)" + required: false + default: true working-directory: description: "Working directory of your Gradle artifacts. (Default is .)" required: false default: "." - -outputs: - release-version: - description: "The bumped version of your release." - value: ${{ steps.evaluate-version.outputs.release-version }} - runs: using: "composite" steps: - name: Check out repository uses: bakdata/ci-templates/actions/checkout@1.32.0 - with: - fetch-depth: 0 - token: ${{ inputs.github-token }} - - - name: Setup git - run: | - git config user.email ${{ inputs.github-email }} - git config user.name ${{ inputs.github-username }} - shell: bash - - - name: Setup semver - run: | - wget -O /usr/local/bin/semver https://raw.githubusercontent.com/fsaintjacques/semver-tool/3.3.0/src/semver - chmod +x /usr/local/bin/semver - shell: bash - name: Set up Gradle with version ${{ inputs.gradle-version }} uses: bakdata/ci-templates/actions/java-gradle-setup@v1.16.0 @@ -74,39 +40,19 @@ runs: gradle-version: ${{ inputs.gradle-version }} gradle-cache: ${{ inputs.gradle-cache }} - - name: Bump version - id: evaluate-version - run: | - old_version=$(./gradlew properties -q | grep "^version:" | awk '{print $2}' | tr -d '[:space:]' | xargs) - if [[ "${{ inputs.release-type }}" == "patch" ]]; then - release_version="${old_version%-*}" - else - release_version=$(semver bump "${{ inputs.release-type }}" "${old_version}") - fi - echo "release-version=$release_version" >> "$GITHUB_OUTPUT" + - name: Compile + run: ./gradlew --info --stacktrace build -x test shell: bash + working-directory: ${{ inputs.working-directory }} - - name: Create release - run: ./gradlew release -x test -Prelease.useAutomaticVersion=true -Prelease.releaseVersion=${{ steps.evaluate-version.outputs.release-version }} -PdisablePushToRemote=true + - name: Build jar + run: ./gradlew --info --stacktrace jar shell: bash working-directory: ${{ inputs.working-directory }} - - name: Create changelog - id: build-changelog - uses: bakdata/ci-templates/actions/changelog-generate@feat/gradle-release - # uses: bakdata/ci-templates/actions/changelog-generate@1.35.0 - with: - github-token: ${{ inputs.github-token }} - new-tag: ${{ steps.evaluate-version.outputs.release-version }} - changelog-file: "${{ inputs.changelog-file }}" - fetch-reviewers: "true" - fetch-release-information: "true" - - - name: Commit and push changes including .bumpversion.cfg file - uses: bakdata/ci-templates/actions/commit-and-push@1.32.0 + - name: Upload build artifact + uses: actions/upload-artifact@v3 with: - ref: ${{ github.event.repository.default_branch }} - commit-message: "Bump version ${{ steps.bump-version.outputs.old-version }} → ${{ steps.bump-version.outputs.release-version }}" - github-username: ${{ inputs.github-username }} - github-email: ${{ inputs.github-email }} - github-token: ${{ inputs.github-token }} + name: ${{ inputs.build-artifact-name }} + path: ${{ inputs.working-directory }}/**/build/libs/*.jar + retention-days: 1 diff --git a/actions/java-gradle-release/action.yaml b/actions/java-gradle-release/action.yaml index e720ca6cd..4da9def14 100644 --- a/actions/java-gradle-release/action.yaml +++ b/actions/java-gradle-release/action.yaml @@ -96,7 +96,7 @@ runs: fetch-reviewers: "true" fetch-release-information: "true" - - name: Commit and push changes including .bumpversion.cfg file + - name: Commit and push changes including the bump config file uses: bakdata/ci-templates/actions/commit-and-push@1.32.0 with: ref: ${{ github.event.repository.default_branch }} From 3e6c6721a3eccd502e9a27b6e1f7561339631276 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Wed, 27 Sep 2023 13:40:31 +0200 Subject: [PATCH 04/27] Add publish --- actions/java-gradle-release/action.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/actions/java-gradle-release/action.yaml b/actions/java-gradle-release/action.yaml index 4da9def14..f94010219 100644 --- a/actions/java-gradle-release/action.yaml +++ b/actions/java-gradle-release/action.yaml @@ -91,7 +91,8 @@ runs: uses: bakdata/ci-templates/actions/changelog-generate@1.33.0 with: github-token: ${{ inputs.github-token }} - new-tag: ${{ steps.evaluate-version.outputs.release-version }} + new-tag: "2.3.0" + # new-tag: ${{ steps.evaluate-version.outputs.release-version }} changelog-file: "${{ inputs.changelog-file }}" fetch-reviewers: "true" fetch-release-information: "true" From bc5e78a8d1e015ab2ead84af3a11855e1cf4eb37 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Thu, 28 Sep 2023 10:26:33 +0200 Subject: [PATCH 05/27] Test the tmp dir --- actions/changelog-generate/action.yaml | 6 ++++++ actions/java-gradle-release/action.yaml | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/actions/changelog-generate/action.yaml b/actions/changelog-generate/action.yaml index 4309ab9d5..d5ff1d7e9 100644 --- a/actions/changelog-generate/action.yaml +++ b/actions/changelog-generate/action.yaml @@ -120,8 +120,14 @@ runs: fi # Update global changelog and pass it to the ouput + echo "--------------------------------------------------------------------------------------------------------" + echo "--------------------------------------------------------------------------------------------------------" + cat ${{ runner.temp }}/changes.md + echo "--------------------------------------------------------------------------------------------------------" + echo "--------------------------------------------------------------------------------------------------------" sed -i "2i $(sed ':a;N;$!ba;s/\n/\\n/g' ${{ runner.temp }}/changes.md)" ${{ inputs.changelog-file }} + echo 'merged-changelog<> $GITHUB_OUTPUT cat ${{ inputs.changelog-file }} >> $GITHUB_OUTPUT echo 'EOF' >> $GITHUB_OUTPUT diff --git a/actions/java-gradle-release/action.yaml b/actions/java-gradle-release/action.yaml index f94010219..8461c582b 100644 --- a/actions/java-gradle-release/action.yaml +++ b/actions/java-gradle-release/action.yaml @@ -91,8 +91,8 @@ runs: uses: bakdata/ci-templates/actions/changelog-generate@1.33.0 with: github-token: ${{ inputs.github-token }} - new-tag: "2.3.0" - # new-tag: ${{ steps.evaluate-version.outputs.release-version }} + # new-tag: "2.3.0" + new-tag: ${{ steps.evaluate-version.outputs.release-version }} changelog-file: "${{ inputs.changelog-file }}" fetch-reviewers: "true" fetch-release-information: "true" From e1a211ad51a9d79f807a140e3ba18340ee42bd59 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Thu, 28 Sep 2023 11:44:19 +0200 Subject: [PATCH 06/27] Test the tmp dir --- actions/java-gradle-release/action.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/actions/java-gradle-release/action.yaml b/actions/java-gradle-release/action.yaml index 8461c582b..2452f2b4a 100644 --- a/actions/java-gradle-release/action.yaml +++ b/actions/java-gradle-release/action.yaml @@ -81,18 +81,18 @@ runs: echo "release-version=$release_version" >> "$GITHUB_OUTPUT" shell: bash - - name: Create release - run: ./gradlew release -x test -Prelease.useAutomaticVersion=true -Prelease.releaseVersion=${{ steps.evaluate-version.outputs.release-version }} -PdisablePushToRemote=true - shell: bash - working-directory: ${{ inputs.working-directory }} + # - name: Create release + # run: ./gradlew release -x test -Prelease.useAutomaticVersion=true -Prelease.releaseVersion=${{ steps.evaluate-version.outputs.release-version }} -PdisablePushToRemote=true + # shell: bash + # working-directory: ${{ inputs.working-directory }} - name: Create changelog id: build-changelog uses: bakdata/ci-templates/actions/changelog-generate@1.33.0 with: github-token: ${{ inputs.github-token }} - # new-tag: "2.3.0" - new-tag: ${{ steps.evaluate-version.outputs.release-version }} + new-tag: "2.3.0" + # new-tag: ${{ steps.evaluate-version.outputs.release-version }} changelog-file: "${{ inputs.changelog-file }}" fetch-reviewers: "true" fetch-release-information: "true" From dbe36800a791b32176ffeaa67d3a512efbdb24c5 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Thu, 28 Sep 2023 11:48:43 +0200 Subject: [PATCH 07/27] Test the tmp dir --- actions/java-gradle-release/action.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/actions/java-gradle-release/action.yaml b/actions/java-gradle-release/action.yaml index 2452f2b4a..cc432215c 100644 --- a/actions/java-gradle-release/action.yaml +++ b/actions/java-gradle-release/action.yaml @@ -80,6 +80,14 @@ runs: fi echo "release-version=$release_version" >> "$GITHUB_OUTPUT" shell: bash + - name: Test version + run: | + echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++" + echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++" + echo "${{ steps.evaluate-version.outputs.release-version }}" + echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++" + echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++" + shell: bash # - name: Create release # run: ./gradlew release -x test -Prelease.useAutomaticVersion=true -Prelease.releaseVersion=${{ steps.evaluate-version.outputs.release-version }} -PdisablePushToRemote=true @@ -88,7 +96,7 @@ runs: - name: Create changelog id: build-changelog - uses: bakdata/ci-templates/actions/changelog-generate@1.33.0 + uses: bakdata/ci-templates/actions/changelog-generate@feat/gradle-release with: github-token: ${{ inputs.github-token }} new-tag: "2.3.0" From f09201eb19bc88fa7f851f049c9c0f6c7c8ec670 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Thu, 28 Sep 2023 11:55:00 +0200 Subject: [PATCH 08/27] Test the tmp dir --- .github/workflows/java-gradle-release.yaml | 6 ++++++ actions/java-gradle-release/action.yaml | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/.github/workflows/java-gradle-release.yaml b/.github/workflows/java-gradle-release.yaml index b4afbdeba..be068e126 100644 --- a/.github/workflows/java-gradle-release.yaml +++ b/.github/workflows/java-gradle-release.yaml @@ -9,6 +9,11 @@ on: required: true type: string + changelog-file: + description: Path to the changelog file in the GitHub repository + required: false + default: "CHANGELOG.md" + type: string gradle-cache: description: "Whether Gradle caching is enabled or not. (Default is true)" required: false @@ -67,6 +72,7 @@ jobs: # uses: bakdata/ci-templates/actions/java-gradle-release@1.35.0 with: release-type: ${{ inputs.release-type }} + changelog-file: "${{ inputs.changelog-file }}" github-email: ${{ secrets.github-email }} github-username: ${{ secrets.github-username }} github-token: ${{ secrets.github-token }} diff --git a/actions/java-gradle-release/action.yaml b/actions/java-gradle-release/action.yaml index cc432215c..8a94c8cb5 100644 --- a/actions/java-gradle-release/action.yaml +++ b/actions/java-gradle-release/action.yaml @@ -2,6 +2,10 @@ name: "Release Java artifacts" description: "Release Java Gradle artifacts on Github" inputs: + changelog-file: + description: Path to the changelog file in the GitHub repository + required: false + default: "CHANGELOG.md" release-type: description: "Scope of the release" required: true From 36089ca683104e2c37c4df055f5dede83a51fbd8 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Thu, 28 Sep 2023 11:57:25 +0200 Subject: [PATCH 09/27] Test the tmp dir --- actions/java-gradle-release/action.yaml | 28 ++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/actions/java-gradle-release/action.yaml b/actions/java-gradle-release/action.yaml index 8a94c8cb5..f96c88636 100644 --- a/actions/java-gradle-release/action.yaml +++ b/actions/java-gradle-release/action.yaml @@ -84,27 +84,27 @@ runs: fi echo "release-version=$release_version" >> "$GITHUB_OUTPUT" shell: bash - - name: Test version - run: | - echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++" - echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++" - echo "${{ steps.evaluate-version.outputs.release-version }}" - echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++" - echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++" - shell: bash - - # - name: Create release - # run: ./gradlew release -x test -Prelease.useAutomaticVersion=true -Prelease.releaseVersion=${{ steps.evaluate-version.outputs.release-version }} -PdisablePushToRemote=true + # - name: Test version + # run: | + # echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++" + # echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++" + # echo "${{ steps.evaluate-version.outputs.release-version }}" + # echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++" + # echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++" # shell: bash - # working-directory: ${{ inputs.working-directory }} + + - name: Create release + run: ./gradlew release -x test -Prelease.useAutomaticVersion=true -Prelease.releaseVersion=${{ steps.evaluate-version.outputs.release-version }} -PdisablePushToRemote=true + shell: bash + working-directory: ${{ inputs.working-directory }} - name: Create changelog id: build-changelog uses: bakdata/ci-templates/actions/changelog-generate@feat/gradle-release with: github-token: ${{ inputs.github-token }} - new-tag: "2.3.0" - # new-tag: ${{ steps.evaluate-version.outputs.release-version }} + # new-tag: "2.3.0" + new-tag: ${{ steps.evaluate-version.outputs.release-version }} changelog-file: "${{ inputs.changelog-file }}" fetch-reviewers: "true" fetch-release-information: "true" From 8f8e3cda51fdeb196995f5ca5f1bab27979fa68b Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Thu, 28 Sep 2023 11:57:44 +0200 Subject: [PATCH 10/27] Test the tmp dir --- actions/changelog-generate/action.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/actions/changelog-generate/action.yaml b/actions/changelog-generate/action.yaml index d5ff1d7e9..99daab8d8 100644 --- a/actions/changelog-generate/action.yaml +++ b/actions/changelog-generate/action.yaml @@ -120,11 +120,11 @@ runs: fi # Update global changelog and pass it to the ouput - echo "--------------------------------------------------------------------------------------------------------" - echo "--------------------------------------------------------------------------------------------------------" - cat ${{ runner.temp }}/changes.md - echo "--------------------------------------------------------------------------------------------------------" - echo "--------------------------------------------------------------------------------------------------------" + # echo "--------------------------------------------------------------------------------------------------------" + # echo "--------------------------------------------------------------------------------------------------------" + # cat ${{ runner.temp }}/changes.md + # echo "--------------------------------------------------------------------------------------------------------" + # echo "--------------------------------------------------------------------------------------------------------" sed -i "2i $(sed ':a;N;$!ba;s/\n/\\n/g' ${{ runner.temp }}/changes.md)" ${{ inputs.changelog-file }} From 85a46a475bcef6b6e5f011c6853f3ee1d5ccde43 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Thu, 28 Sep 2023 14:43:13 +0200 Subject: [PATCH 11/27] Clean code --- actions/changelog-generate/action.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/actions/changelog-generate/action.yaml b/actions/changelog-generate/action.yaml index 99daab8d8..4309ab9d5 100644 --- a/actions/changelog-generate/action.yaml +++ b/actions/changelog-generate/action.yaml @@ -120,14 +120,8 @@ runs: fi # Update global changelog and pass it to the ouput - # echo "--------------------------------------------------------------------------------------------------------" - # echo "--------------------------------------------------------------------------------------------------------" - # cat ${{ runner.temp }}/changes.md - # echo "--------------------------------------------------------------------------------------------------------" - # echo "--------------------------------------------------------------------------------------------------------" sed -i "2i $(sed ':a;N;$!ba;s/\n/\\n/g' ${{ runner.temp }}/changes.md)" ${{ inputs.changelog-file }} - echo 'merged-changelog<> $GITHUB_OUTPUT cat ${{ inputs.changelog-file }} >> $GITHUB_OUTPUT echo 'EOF' >> $GITHUB_OUTPUT From 675181ae68cd4c59871ad738c5c6599d4f67b3f2 Mon Sep 17 00:00:00 2001 From: Salomon Popp Date: Thu, 28 Sep 2023 14:59:12 +0200 Subject: [PATCH 12/27] Test with automatic changelog branch --- actions/java-gradle-release/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/java-gradle-release/action.yaml b/actions/java-gradle-release/action.yaml index f96c88636..403e2c6f2 100644 --- a/actions/java-gradle-release/action.yaml +++ b/actions/java-gradle-release/action.yaml @@ -100,7 +100,7 @@ runs: - name: Create changelog id: build-changelog - uses: bakdata/ci-templates/actions/changelog-generate@feat/gradle-release + uses: bakdata/ci-templates/actions/changelog-generate@chore/automatic-changelog with: github-token: ${{ inputs.github-token }} # new-tag: "2.3.0" From 2c84b8f4a8645c8c8e868e3433e1abcde377b6fa Mon Sep 17 00:00:00 2001 From: Salomon Popp Date: Thu, 28 Sep 2023 14:59:27 +0200 Subject: [PATCH 13/27] Fix string --- actions/java-gradle-release/action.yaml | 2 +- actions/java-gradle-setup/action.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/actions/java-gradle-release/action.yaml b/actions/java-gradle-release/action.yaml index 403e2c6f2..81dce79e3 100644 --- a/actions/java-gradle-release/action.yaml +++ b/actions/java-gradle-release/action.yaml @@ -33,7 +33,7 @@ inputs: gradle-cache: description: "Whether Gradle caching is enabled or not. (Default is true)" required: false - default: true + default: "true" working-directory: description: "Working directory of your Gradle artifacts. (Default is .)" required: false diff --git a/actions/java-gradle-setup/action.yaml b/actions/java-gradle-setup/action.yaml index 132802d72..7949bcdfc 100644 --- a/actions/java-gradle-setup/action.yaml +++ b/actions/java-gradle-setup/action.yaml @@ -17,7 +17,7 @@ inputs: gradle-cache: description: "Whether Gradle caching is enabled or not. (Default is true)" required: false - default: true + default: "true" runs: using: "composite" steps: From 0d9840e0edd10144414044c35226347dbf155f1d Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Fri, 29 Sep 2023 11:11:22 +0200 Subject: [PATCH 14/27] Update version and clean code --- .github/workflows/java-gradle-release.yaml | 3 +-- actions/java-gradle-release/action.yaml | 9 --------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/java-gradle-release.yaml b/.github/workflows/java-gradle-release.yaml index be068e126..2cd59c5a0 100644 --- a/.github/workflows/java-gradle-release.yaml +++ b/.github/workflows/java-gradle-release.yaml @@ -68,8 +68,7 @@ jobs: steps: - name: Release on Github id: release - uses: bakdata/ci-templates/actions/java-gradle-release@feat/gradle-release - # uses: bakdata/ci-templates/actions/java-gradle-release@1.35.0 + uses: bakdata/ci-templates/actions/java-gradle-release@1.35.2 with: release-type: ${{ inputs.release-type }} changelog-file: "${{ inputs.changelog-file }}" diff --git a/actions/java-gradle-release/action.yaml b/actions/java-gradle-release/action.yaml index f96c88636..b739b113c 100644 --- a/actions/java-gradle-release/action.yaml +++ b/actions/java-gradle-release/action.yaml @@ -84,14 +84,6 @@ runs: fi echo "release-version=$release_version" >> "$GITHUB_OUTPUT" shell: bash - # - name: Test version - # run: | - # echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++" - # echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++" - # echo "${{ steps.evaluate-version.outputs.release-version }}" - # echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++" - # echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++" - # shell: bash - name: Create release run: ./gradlew release -x test -Prelease.useAutomaticVersion=true -Prelease.releaseVersion=${{ steps.evaluate-version.outputs.release-version }} -PdisablePushToRemote=true @@ -103,7 +95,6 @@ runs: uses: bakdata/ci-templates/actions/changelog-generate@feat/gradle-release with: github-token: ${{ inputs.github-token }} - # new-tag: "2.3.0" new-tag: ${{ steps.evaluate-version.outputs.release-version }} changelog-file: "${{ inputs.changelog-file }}" fetch-reviewers: "true" From 60f9238c26a14aef899f737904fe71f41a1f4211 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Fri, 29 Sep 2023 16:52:05 +0200 Subject: [PATCH 15/27] Clean code --- actions/java-gradle-release/README.md | 23 ++++++++++++----------- actions/java-gradle-release/action.yaml | 3 +-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/actions/java-gradle-release/README.md b/actions/java-gradle-release/README.md index 597b353e1..3a27a3421 100644 --- a/actions/java-gradle-release/README.md +++ b/actions/java-gradle-release/README.md @@ -4,17 +4,18 @@ This action releases Java Gradle artifacts by createing a tag on GitHub. ## Input Parameters -| Name | Required | Default Value | Type | Description | -| ----------------- | :------: | :-----------: | :-----: | ------------------------------------------------------------------------------------------------------------- | -| release-type | ✅ | - | string | Scope of the release | -| github-email | ✅ | - | string | GitHub email for requesting changes from API | -| github-username | ✅ | - | string | GitHub username for requesting changes from API | -| github-token | ✅ | - | string | GitHub token for requesting changes from API | -| java-distribution | ❌ | microsoft | string | [Java distribution](https://github.com/actions/setup-java#supported-distributions) to be installed | -| java-version | ❌ | 11 | string | Java version to be installed | -| gradle-version | ❌ | wrapper | string | [Gradle version](https://github.com/gradle/gradle-build-action#use-a-specific-gradle-version) to be installed | -| gradle-cache | ❌ | true | boolean | Whether Gradle caching is enabled or not | -| working-directory | ❌ | "." | string | Working directory of your Gradle artifacts | +| Name | Required | Default Value | Type | Description | +| ----------------- | :------: | :------------: | :---------------------------: | ------------------------------------------------------------------------------------------------------------- | +| changelog-file | ❌ | "CHANGELOG.md" | Path to the Changelog.md file | +| release-type | ✅ | - | string | Scope of the release | +| github-email | ✅ | - | string | GitHub email for requesting changes from API | +| github-username | ✅ | - | string | GitHub username for requesting changes from API | +| github-token | ✅ | - | string | GitHub token for requesting changes from API | +| java-distribution | ❌ | microsoft | string | [Java distribution](https://github.com/actions/setup-java#supported-distributions) to be installed | +| java-version | ❌ | 11 | string | Java version to be installed | +| gradle-version | ❌ | wrapper | string | [Gradle version](https://github.com/gradle/gradle-build-action#use-a-specific-gradle-version) to be installed | +| gradle-cache | ❌ | true | boolean | Whether Gradle caching is enabled or not | +| working-directory | ❌ | "." | string | Working directory of your Gradle artifacts | ## Usage diff --git a/actions/java-gradle-release/action.yaml b/actions/java-gradle-release/action.yaml index f1f689da7..c8e274895 100644 --- a/actions/java-gradle-release/action.yaml +++ b/actions/java-gradle-release/action.yaml @@ -92,12 +92,11 @@ runs: - name: Create changelog id: build-changelog - uses: bakdata/ci-templates/actions/changelog-generate@chore/automatic-changelog + uses: bakdata/ci-templates/actions/changelog-generate@1.35.2 with: github-token: ${{ inputs.github-token }} new-tag: ${{ steps.evaluate-version.outputs.release-version }} changelog-file: "${{ inputs.changelog-file }}" - fetch-reviewers: "true" fetch-release-information: "true" - name: Commit and push changes including the bump config file From 42e6b2c6b70a09e49c3079620021a2c4780776b8 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Fri, 29 Sep 2023 16:55:22 +0200 Subject: [PATCH 16/27] Clean code --- actions/java-gradle-release/README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/actions/java-gradle-release/README.md b/actions/java-gradle-release/README.md index 3a27a3421..ae6de9cbe 100644 --- a/actions/java-gradle-release/README.md +++ b/actions/java-gradle-release/README.md @@ -4,18 +4,18 @@ This action releases Java Gradle artifacts by createing a tag on GitHub. ## Input Parameters -| Name | Required | Default Value | Type | Description | -| ----------------- | :------: | :------------: | :---------------------------: | ------------------------------------------------------------------------------------------------------------- | -| changelog-file | ❌ | "CHANGELOG.md" | Path to the Changelog.md file | -| release-type | ✅ | - | string | Scope of the release | -| github-email | ✅ | - | string | GitHub email for requesting changes from API | -| github-username | ✅ | - | string | GitHub username for requesting changes from API | -| github-token | ✅ | - | string | GitHub token for requesting changes from API | -| java-distribution | ❌ | microsoft | string | [Java distribution](https://github.com/actions/setup-java#supported-distributions) to be installed | -| java-version | ❌ | 11 | string | Java version to be installed | -| gradle-version | ❌ | wrapper | string | [Gradle version](https://github.com/gradle/gradle-build-action#use-a-specific-gradle-version) to be installed | -| gradle-cache | ❌ | true | boolean | Whether Gradle caching is enabled or not | -| working-directory | ❌ | "." | string | Working directory of your Gradle artifacts | +| Name | Required | Default Value | Type | Description | +| ----------------- | :------: | :------------: | :-----: | ------------------------------------------------------------------------------------------------------------- | +| changelog-file | ❌ | "CHANGELOG.md" | string | Path to the Changelog.md file | +| release-type | ✅ | - | string | Scope of the release | +| github-email | ✅ | - | string | GitHub email for requesting changes from API | +| github-username | ✅ | - | string | GitHub username for requesting changes from API | +| github-token | ✅ | - | string | GitHub token for requesting changes from API | +| java-distribution | ❌ | microsoft | string | [Java distribution](https://github.com/actions/setup-java#supported-distributions) to be installed | +| java-version | ❌ | 11 | string | Java version to be installed | +| gradle-version | ❌ | wrapper | string | [Gradle version](https://github.com/gradle/gradle-build-action#use-a-specific-gradle-version) to be installed | +| gradle-cache | ❌ | true | boolean | Whether Gradle caching is enabled or not | +| working-directory | ❌ | "." | string | Working directory of your Gradle artifacts | ## Usage From 206b1aa4d7dcc007af32fb801c5ab28f4b650ca7 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Wed, 4 Oct 2023 11:50:12 +0200 Subject: [PATCH 17/27] Update the java gradle release github action --- actions/java-gradle-release-github/README.md | 19 ++++++++++--------- .../java-gradle-release-github/action.yaml | 19 ++++++++++++------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/actions/java-gradle-release-github/README.md b/actions/java-gradle-release-github/README.md index 1e20a7c7d..c35ffd09d 100644 --- a/actions/java-gradle-release-github/README.md +++ b/actions/java-gradle-release-github/README.md @@ -4,15 +4,16 @@ This action releases Java Gradle Artifacts and a generated changelog on Github. ## Input Parameters -| Name | Required | Default Value | Type | Description | -| ----------------- | :------: | :-----------: | :-----: | ------------------------------------------------------------------------------------------------------------- | -| github-username | ✅ | - | string | GitHub username for requesting changes from API | -| github-token | ✅ | - | string | GitHub token for requesting changes from API | -| java-distribution | ❌ | microsoft | string | [Java distribution](https://github.com/actions/setup-java#supported-distributions) to be installed | -| java-version | ❌ | 11 | string | Java version to be installed | -| gradle-version | ❌ | wrapper | string | [Gradle version](https://github.com/gradle/gradle-build-action#use-a-specific-gradle-version) to be installed | -| gradle-cache | ❌ | true | boolean | Whether Gradle caching is enabled or not | -| working-directory | ❌ | "." | string | Working directory of your Gradle artifacts | +| Name | Required | Default Value | Type | Description | +| ----------------- | :------: | :------------: | :-----: | ------------------------------------------------------------------------------------------------------------- | +| changelog-file | ❌ | "CHANGELOG.md" | string | Path to the Changelog.md file | +| github-username | ✅ | - | string | GitHub username for requesting changes from API | +| github-token | ✅ | - | string | GitHub token for requesting changes from API | +| java-distribution | ❌ | microsoft | string | [Java distribution](https://github.com/actions/setup-java#supported-distributions) to be installed | +| java-version | ❌ | 11 | string | Java version to be installed | +| gradle-version | ❌ | wrapper | string | [Gradle version](https://github.com/gradle/gradle-build-action#use-a-specific-gradle-version) to be installed | +| gradle-cache | ❌ | true | boolean | Whether Gradle caching is enabled or not | +| working-directory | ❌ | "." | string | Working directory of your Gradle artifacts | ## Usage diff --git a/actions/java-gradle-release-github/action.yaml b/actions/java-gradle-release-github/action.yaml index bec53a5bd..17682a528 100644 --- a/actions/java-gradle-release-github/action.yaml +++ b/actions/java-gradle-release-github/action.yaml @@ -2,6 +2,10 @@ name: "Release Java artifacts" description: "Release Java Gradle artifacts on Github" inputs: + changelog-file: + description: Path to the changelog file in the GitHub repository + required: false + default: "CHANGELOG.md" github-username: description: "GitHub username for requesting changes from API." required: true @@ -48,13 +52,14 @@ runs: gradle-version: ${{ inputs.gradle-version }} gradle-cache: ${{ inputs.gradle-cache }} - - name: Generate changelog - run: ./gradlew -Pchangelog.releaseVersion=${GITHUB_REF##*/} -Pchangelog.sinceTag=${GITHUB_REF##*/} --stacktrace --info generateChangelog - shell: bash - working-directory: ${{ inputs.working-directory }} - env: - GITHUB_USER: ${{ inputs.github-username }} - GITHUB_TOKEN: ${{ inputs.github-token }} + - name: Create changelog + id: build-changelog + uses: bakdata/ci-templates/actions/changelog-generate@1.35.2 + with: + github-token: ${{ inputs.github-token }} + new-tag: ${GITHUB_REF##*/} + changelog-file: "${{ inputs.changelog-file }}" + fetch-release-information: "true" - name: Create Github release uses: softprops/action-gh-release@v1 From 721630a59045e380391d57aa561fc72a8a302af2 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Wed, 4 Oct 2023 15:04:48 +0200 Subject: [PATCH 18/27] Sort vars --- actions/java-gradle-release/action.yaml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/actions/java-gradle-release/action.yaml b/actions/java-gradle-release/action.yaml index c8e274895..9c61f34cd 100644 --- a/actions/java-gradle-release/action.yaml +++ b/actions/java-gradle-release/action.yaml @@ -2,10 +2,6 @@ name: "Release Java artifacts" description: "Release Java Gradle artifacts on Github" inputs: - changelog-file: - description: Path to the changelog file in the GitHub repository - required: false - default: "CHANGELOG.md" release-type: description: "Scope of the release" required: true @@ -18,6 +14,18 @@ inputs: github-token: description: "GitHub token for requesting changes from API." required: true + changelog-file: + description: Path to the changelog file in the GitHub repository + required: false + default: "CHANGELOG.md" + gradle-cache: + description: "Whether Gradle caching is enabled or not. (Default is true)" + required: false + default: "true" + gradle-version: + description: "Gradle version to be installed. (Default is wrapper)" + required: false + default: "wrapper" java-distribution: description: "Java distribution to be installed. (Default is microsoft)" required: false @@ -26,14 +34,6 @@ inputs: description: "Java version to be installed. (Default is 11)" required: false default: "11" - gradle-version: - description: "Gradle version to be installed. (Default is wrapper)" - required: false - default: "wrapper" - gradle-cache: - description: "Whether Gradle caching is enabled or not. (Default is true)" - required: false - default: "true" working-directory: description: "Working directory of your Gradle artifacts. (Default is .)" required: false From fe6e1d30418ee13561b99760fb8b8424da43e185 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Wed, 4 Oct 2023 16:12:10 +0200 Subject: [PATCH 19/27] Remove gradle setup action from the gradle release gh --- actions/java-gradle-release-github/action.yaml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/actions/java-gradle-release-github/action.yaml b/actions/java-gradle-release-github/action.yaml index 79730e2c0..36e404e70 100644 --- a/actions/java-gradle-release-github/action.yaml +++ b/actions/java-gradle-release-github/action.yaml @@ -44,14 +44,6 @@ runs: name: build-artifact path: build - - name: Set up Gradle with version ${{ inputs.gradle-version }} - uses: bakdata/ci-templates/actions/java-gradle-setup@v1.16.0 - with: - java-distribution: ${{ inputs.java-distribution }} - java-version: ${{ inputs.java-version }} - gradle-version: ${{ inputs.gradle-version }} - gradle-cache: ${{ inputs.gradle-cache }} - - name: Create changelog id: build-changelog uses: bakdata/ci-templates/actions/changelog-generate@1.35.2 From 7b34e014b3e21ddc6065e44ccb36b14d95f4ebae Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Fri, 6 Oct 2023 14:51:54 +0200 Subject: [PATCH 20/27] Update documentation --- .github/workflows/README.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index f180df557..952679b35 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -973,14 +973,15 @@ This workflow is built from another composite action listed below: ### Input Parameters -| Name | Required | Default Value | Type | Description | -| ----------------- | :------: | :-----------: | :-----: | ------------------------------------------------------------------------------------------------------------- | -| release-type | ✅ | - | string | Scope of the release (major, minor or patch) | -| java-distribution | ❌ | microsoft | string | [Java distribution](https://github.com/actions/setup-java#supported-distributions) to be installed | -| java-version | ❌ | 11 | string | Java version to be installed | -| gradle-version | ❌ | wrapper | string | [Gradle version](https://github.com/gradle/gradle-build-action#use-a-specific-gradle-version) to be installed | -| gradle-cache | ❌ | true | boolean | Whether Gradle caching is enabled or not | -| working-directory | ❌ | . | string | Working directory of your Gradle artifacts | +| Name | Required | Default Value | Type | Description | +| ----------------- | :------: | :------------: | :-----: | ------------------------------------------------------------------------------------------------------------- | +| release-type | ✅ | - | string | Scope of the release (major, minor or patch) | +| changelog-file | ❌ | "CHANGELOG.md" | string | Path to the Changelog.md file | +| gradle-cache | ❌ | true | boolean | Whether Gradle caching is enabled or not | +| gradle-version | ❌ | wrapper | string | [Gradle version](https://github.com/gradle/gradle-build-action#use-a-specific-gradle-version) to be installed | +| java-distribution | ❌ | microsoft | string | [Java distribution](https://github.com/actions/setup-java#supported-distributions) to be installed | +| java-version | ❌ | 11 | string | Java version to be installed | +| working-directory | ❌ | . | string | Working directory of your Gradle artifacts | ### Secret Parameters From f7c4acc706f505773339a4bf6eaa5a4795d76311 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Fri, 6 Oct 2023 15:44:09 +0200 Subject: [PATCH 21/27] Add gh release --- actions/java-gradle-release/action.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/actions/java-gradle-release/action.yaml b/actions/java-gradle-release/action.yaml index 9c61f34cd..2f3722c72 100644 --- a/actions/java-gradle-release/action.yaml +++ b/actions/java-gradle-release/action.yaml @@ -107,3 +107,13 @@ runs: github-username: ${{ inputs.github-username }} github-email: ${{ inputs.github-email }} github-token: ${{ inputs.github-token }} + + - name: Tag and release + uses: bakdata/ci-templates/actions/tag-and-release@v1.22.0 + with: + tag: "${{ steps.evaluate-version.outputs.release-version }}" + release-title: "${{ steps.evaluate-version.outputs.release-version }}" + release-body: "${{ steps.build-changelog.outputs.single-changelog }}" + github-username: ${{ secrets.github-username }} + github-email: ${{ secrets.github-email }} + github-token: ${{ secrets.github-token }} From a7c3db6d1c56b1eca492571a89d456ca72e771c3 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Mon, 9 Oct 2023 10:55:52 +0200 Subject: [PATCH 22/27] Allow to push tag --- .github/workflows/java-gradle-docker.yaml | 2 +- actions/java-gradle-release/action.yaml | 22 +++++----------------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/.github/workflows/java-gradle-docker.yaml b/.github/workflows/java-gradle-docker.yaml index 7294e39f9..1fcaaf0b6 100644 --- a/.github/workflows/java-gradle-docker.yaml +++ b/.github/workflows/java-gradle-docker.yaml @@ -155,7 +155,7 @@ jobs: name: Create Github release if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-22.04 - needs: publish + needs: [ publish, publish-jib-image] steps: - name: Release on Github diff --git a/actions/java-gradle-release/action.yaml b/actions/java-gradle-release/action.yaml index 2f3722c72..d24be9d27 100644 --- a/actions/java-gradle-release/action.yaml +++ b/actions/java-gradle-release/action.yaml @@ -100,20 +100,8 @@ runs: fetch-release-information: "true" - name: Commit and push changes including the bump config file - uses: bakdata/ci-templates/actions/commit-and-push@1.32.0 - with: - ref: ${{ github.event.repository.default_branch }} - commit-message: "Changelog for version ${{ steps.evaluate-version.outputs.release-version }}" - github-username: ${{ inputs.github-username }} - github-email: ${{ inputs.github-email }} - github-token: ${{ inputs.github-token }} - - - name: Tag and release - uses: bakdata/ci-templates/actions/tag-and-release@v1.22.0 - with: - tag: "${{ steps.evaluate-version.outputs.release-version }}" - release-title: "${{ steps.evaluate-version.outputs.release-version }}" - release-body: "${{ steps.build-changelog.outputs.single-changelog }}" - github-username: ${{ secrets.github-username }} - github-email: ${{ secrets.github-email }} - github-token: ${{ secrets.github-token }} + run: | + git add CHANGELOG.md + git commit -m "Changelog for version ${{ steps.evaluate-version.outputs.release-version }}" + git push --follow-tags origin ${{ github.event.repository.default_branch }} + shell: bash From 56a2bfd4006334154f99cbabe37d870da46ce12e Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Mon, 9 Oct 2023 10:56:23 +0200 Subject: [PATCH 23/27] Allow to push tag --- .github/workflows/java-gradle-docker.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/java-gradle-docker.yaml b/.github/workflows/java-gradle-docker.yaml index 1fcaaf0b6..7294e39f9 100644 --- a/.github/workflows/java-gradle-docker.yaml +++ b/.github/workflows/java-gradle-docker.yaml @@ -155,7 +155,7 @@ jobs: name: Create Github release if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-22.04 - needs: [ publish, publish-jib-image] + needs: publish steps: - name: Release on Github From 7d09a7ca7bad10a725886d17f955050c9c9bf094 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Mon, 9 Oct 2023 11:04:14 +0200 Subject: [PATCH 24/27] Test changelog --- actions/java-gradle-release/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/java-gradle-release/action.yaml b/actions/java-gradle-release/action.yaml index d24be9d27..dcb910627 100644 --- a/actions/java-gradle-release/action.yaml +++ b/actions/java-gradle-release/action.yaml @@ -92,7 +92,7 @@ runs: - name: Create changelog id: build-changelog - uses: bakdata/ci-templates/actions/changelog-generate@1.35.2 + uses: bakdata/ci-templates/actions/changelog-generate@feat/changelog-eof with: github-token: ${{ inputs.github-token }} new-tag: ${{ steps.evaluate-version.outputs.release-version }} From 38cc4a537b11c2f33db084ca5d1ea5c40cfbbf37 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Mon, 9 Oct 2023 11:07:22 +0200 Subject: [PATCH 25/27] Test changelog --- actions/java-gradle-release/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/java-gradle-release/action.yaml b/actions/java-gradle-release/action.yaml index dcb910627..d24be9d27 100644 --- a/actions/java-gradle-release/action.yaml +++ b/actions/java-gradle-release/action.yaml @@ -92,7 +92,7 @@ runs: - name: Create changelog id: build-changelog - uses: bakdata/ci-templates/actions/changelog-generate@feat/changelog-eof + uses: bakdata/ci-templates/actions/changelog-generate@1.35.2 with: github-token: ${{ inputs.github-token }} new-tag: ${{ steps.evaluate-version.outputs.release-version }} From b0371b464534d1515e624d89641f7dcdf7c41a73 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Mon, 9 Oct 2023 13:25:28 +0200 Subject: [PATCH 26/27] Update tags --- .github/workflows/java-gradle-release.yaml | 2 +- actions/java-gradle-release-github/action.yaml | 2 +- actions/java-gradle-release/action.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/java-gradle-release.yaml b/.github/workflows/java-gradle-release.yaml index 2cd59c5a0..d4e7738da 100644 --- a/.github/workflows/java-gradle-release.yaml +++ b/.github/workflows/java-gradle-release.yaml @@ -68,7 +68,7 @@ jobs: steps: - name: Release on Github id: release - uses: bakdata/ci-templates/actions/java-gradle-release@1.35.2 + uses: bakdata/ci-templates/actions/java-gradle-release@1.38.0 with: release-type: ${{ inputs.release-type }} changelog-file: "${{ inputs.changelog-file }}" diff --git a/actions/java-gradle-release-github/action.yaml b/actions/java-gradle-release-github/action.yaml index 36e404e70..22f1dc31a 100644 --- a/actions/java-gradle-release-github/action.yaml +++ b/actions/java-gradle-release-github/action.yaml @@ -46,7 +46,7 @@ runs: - name: Create changelog id: build-changelog - uses: bakdata/ci-templates/actions/changelog-generate@1.35.2 + uses: bakdata/ci-templates/actions/changelog-generate@1.37.0 with: github-token: ${{ inputs.github-token }} new-tag: ${GITHUB_REF##*/} diff --git a/actions/java-gradle-release/action.yaml b/actions/java-gradle-release/action.yaml index d24be9d27..0f63153ef 100644 --- a/actions/java-gradle-release/action.yaml +++ b/actions/java-gradle-release/action.yaml @@ -92,7 +92,7 @@ runs: - name: Create changelog id: build-changelog - uses: bakdata/ci-templates/actions/changelog-generate@1.35.2 + uses: bakdata/ci-templates/actions/changelog-generate@1.37.0 with: github-token: ${{ inputs.github-token }} new-tag: ${{ steps.evaluate-version.outputs.release-version }} From 8da7a4e809653dce49aea4d3a8f3051677457291 Mon Sep 17 00:00:00 2001 From: MichaelKora Date: Wed, 11 Oct 2023 10:09:38 +0200 Subject: [PATCH 27/27] Tag next release version --- .github/workflows/python-poetry-release.yaml | 2 +- actions/java-gradle-release-github/action.yaml | 2 +- actions/java-gradle-release/action.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-poetry-release.yaml b/.github/workflows/python-poetry-release.yaml index 9c7bf2313..7975e3d0a 100644 --- a/.github/workflows/python-poetry-release.yaml +++ b/.github/workflows/python-poetry-release.yaml @@ -85,7 +85,7 @@ jobs: - name: Create changelog id: build-changelog - uses: bakdata/ci-templates/actions/changelog-generate@1.37.0 + uses: bakdata/ci-templates/actions/changelog-generate@1.38.0 if: ${{ inputs.changelog == true}} with: github-token: ${{ secrets.github-token }} diff --git a/actions/java-gradle-release-github/action.yaml b/actions/java-gradle-release-github/action.yaml index 22f1dc31a..7182cf252 100644 --- a/actions/java-gradle-release-github/action.yaml +++ b/actions/java-gradle-release-github/action.yaml @@ -46,7 +46,7 @@ runs: - name: Create changelog id: build-changelog - uses: bakdata/ci-templates/actions/changelog-generate@1.37.0 + uses: bakdata/ci-templates/actions/changelog-generate@1.38.0 with: github-token: ${{ inputs.github-token }} new-tag: ${GITHUB_REF##*/} diff --git a/actions/java-gradle-release/action.yaml b/actions/java-gradle-release/action.yaml index 0f63153ef..7db2b671d 100644 --- a/actions/java-gradle-release/action.yaml +++ b/actions/java-gradle-release/action.yaml @@ -92,7 +92,7 @@ runs: - name: Create changelog id: build-changelog - uses: bakdata/ci-templates/actions/changelog-generate@1.37.0 + uses: bakdata/ci-templates/actions/changelog-generate@1.38.0 with: github-token: ${{ inputs.github-token }} new-tag: ${{ steps.evaluate-version.outputs.release-version }}