Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix changelog generation for Gradle projects #184

Merged
merged 35 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
68d21af
Push only once for Gradle releases
philipp94831 Mar 4, 2024
b233fea
Push only once for Gradle releases
philipp94831 Mar 4, 2024
dfc9586
Push only once for Gradle releases
philipp94831 Mar 4, 2024
a4ea903
Push only once for Gradle releases
philipp94831 Mar 4, 2024
697ae1f
Fix changelog generation for Gradle projects
philipp94831 Mar 4, 2024
3106b03
Fix changelog generation for Gradle projects
philipp94831 Mar 4, 2024
4c8b794
Fix changelog generation for Gradle projects
philipp94831 Mar 4, 2024
11639f5
Fix changelog generation for Gradle projects
philipp94831 Mar 4, 2024
f4ebd02
Fix changelog generation for Gradle projects
philipp94831 Mar 4, 2024
c05e6d0
Fix changelog generation for Gradle projects
philipp94831 Mar 4, 2024
cb10d27
Fix changelog generation for Gradle projects
philipp94831 Mar 4, 2024
dd34e44
Fix changelog generation for Gradle projects
philipp94831 Mar 4, 2024
9ceebbb
Fix changelog generation for Gradle projects
philipp94831 Mar 4, 2024
b71751a
Fix changelog generation for Gradle projects
philipp94831 Mar 4, 2024
8f1240c
Fix changelog generation for Gradle projects
philipp94831 Mar 4, 2024
435fa52
Fix changelog generation for Gradle projects
philipp94831 Mar 4, 2024
b36b24d
Merge branch 'feature/single-push' into fix/changelog
philipp94831 Mar 4, 2024
eae8978
Fix changelog generation for Gradle projects
philipp94831 Mar 4, 2024
fc3b46e
Fix changelog generation for Gradle projects
philipp94831 Mar 4, 2024
ee49879
Fix changelog generation for Gradle projects
philipp94831 Mar 4, 2024
9be674f
Fix changelog generation for Gradle projects
philipp94831 Mar 4, 2024
c55975e
Fix changelog generation for Gradle projects
philipp94831 Mar 4, 2024
d12cf71
Fix changelog generation for Gradle projects
philipp94831 Mar 4, 2024
9cd9034
Fix changelog generation for Gradle projects
philipp94831 Mar 4, 2024
81ebfb4
Fix changelog generation for Gradle projects
philipp94831 Mar 4, 2024
2797fce
Fix changelog generation for Gradle projects
philipp94831 Mar 4, 2024
7cac498
Fix changelog generation for Gradle projects
philipp94831 Mar 4, 2024
807c67d
Fix changelog generation for Gradle projects
philipp94831 Mar 4, 2024
f8f7672
Fix changelog generation for Gradle projects
philipp94831 Mar 4, 2024
76c414f
Fix changelog generation for Gradle projects
philipp94831 Mar 4, 2024
8d7fd31
Fix changelog generation for Gradle projects
philipp94831 Mar 4, 2024
73bc0df
Fix changelog generation for Gradle projects
philipp94831 Mar 4, 2024
9f74153
Merge remote-tracking branch 'origin/main' into fix/changelog
philipp94831 Mar 4, 2024
6723839
Fix changelog generation for Gradle projects
philipp94831 Mar 4, 2024
84e5e66
Fix changelog generation for Gradle projects
philipp94831 Mar 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .github/workflows/java-gradle-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ on:
docker-password:
description: "Password for publishing to Dockerhub."
required: true
github-username:
description: "GitHub username for requesting changes from API."
required: true
github-token:
description: "GitHub token for requesting changes from API."
required: true
Expand Down Expand Up @@ -162,12 +159,13 @@ jobs:

steps:
- name: Release on Github
uses: bakdata/ci-templates/actions/java-gradle-release-github@v1.16.0
uses: bakdata/ci-templates/actions/java-gradle-release-github@1.43.0
with:
github-username: ${{ secrets.github-username }}
github-token: ${{ secrets.github-token }}
java-distribution: ${{ inputs.java-distribution }}
java-version: ${{ inputs.java-version }}
gradle-version: ${{ inputs.gradle-version }}
gradle-cache: ${{ inputs.gradle-cache }}
gradle-cache-read-only: true
gradle-refresh-dependencies: ${{ inputs.gradle-refresh-dependencies }}
working-directory: ${{ inputs.working-directory }}
8 changes: 3 additions & 5 deletions .github/workflows/java-gradle-library.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ on:
ossrh-password:
description: "Password for signing into Sonatype repository."
required: true
github-username:
description: "GitHub username for requesting changes from API."
required: true
github-token:
description: "GitHub token for requesting changes from API."
required: true
Expand Down Expand Up @@ -123,12 +120,13 @@ jobs:

steps:
- name: Release on Github
uses: bakdata/ci-templates/actions/java-gradle-release-github@v1.16.0
uses: bakdata/ci-templates/actions/java-gradle-release-github@1.43.0
with:
github-username: ${{ secrets.github-username }}
github-token: ${{ secrets.github-token }}
java-distribution: ${{ inputs.java-distribution }}
java-version: ${{ inputs.java-version }}
gradle-version: ${{ inputs.gradle-version }}
gradle-cache: ${{ inputs.gradle-cache }}
gradle-cache-read-only: true
gradle-refresh-dependencies: ${{ inputs.gradle-refresh-dependencies }}
working-directory: ${{ inputs.working-directory }}
8 changes: 3 additions & 5 deletions .github/workflows/java-gradle-plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ on:
gradle-publish-secret:
description: "Secret for publishing to Gradle Plugin Portal."
required: true
github-username:
description: "GitHub username for requesting changes from API."
required: true
github-token:
description: "GitHub token for requesting changes from API."
required: true
Expand Down Expand Up @@ -151,12 +148,13 @@ jobs:

steps:
- name: Release on Github
uses: bakdata/ci-templates/actions/java-gradle-release-github@v1.16.0
uses: bakdata/ci-templates/actions/java-gradle-release-github@1.43.0
with:
github-username: ${{ secrets.github-username }}
github-token: ${{ secrets.github-token }}
java-distribution: ${{ inputs.java-distribution }}
java-version: ${{ inputs.java-version }}
gradle-version: ${{ inputs.gradle-version }}
gradle-cache: ${{ inputs.gradle-cache }}
gradle-cache-read-only: true
gradle-refresh-dependencies: ${{ inputs.gradle-refresh-dependencies }}
working-directory: ${{ inputs.working-directory }}
1 change: 0 additions & 1 deletion .github/workflows/java-gradle-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ jobs:
uses: bakdata/ci-templates/actions/[email protected]
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 }}
Expand Down
58 changes: 46 additions & 12 deletions actions/java-gradle-release-github/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,70 @@ 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-token:
description: "GitHub token for requesting changes from API."
required: true
java-distribution:
description: "Java distribution to be installed. (Default is microsoft)"
required: false
default: "microsoft"
java-version:
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
gradle-cache-read-only:
description: "Whether Gradle caching should be read-only. By default this value is 'false' for workflows on the GitHub default branch and 'true' for workflows on other branches."
required: false
default: ${{ github.event.repository != null && github.ref_name != github.event.repository.default_branch }}
gradle-refresh-dependencies:
description: "Whether Gradle should refresh dependencies. (Default is false)"
required: false
default: "false"
working-directory:
description: "Working directory of your Gradle artifacts. (Default is .)"
required: false
default: "."
runs:
using: "composite"
steps:
- name: Check out repository
uses: bakdata/ci-templates/actions/[email protected]
with:
fetch-depth: 0

- name: Download build artifact
uses: actions/download-artifact@v3
with:
name: build-artifact
path: build

- name: Create changelog
id: build-changelog
uses: bakdata/ci-templates/actions/[email protected]
- name: Set up Gradle with version ${{ inputs.gradle-version }}
uses: bakdata/ci-templates/actions/[email protected]
with:
github-token: ${{ inputs.github-token }}
new-tag: ${GITHUB_REF##*/}
changelog-file: "${{ inputs.changelog-file }}"
fetch-release-information: "true"
java-distribution: ${{ inputs.java-distribution }}
java-version: ${{ inputs.java-version }}
gradle-version: ${{ inputs.gradle-version }}
gradle-cache: ${{ inputs.gradle-cache }}
gradle-cache-read-only: ${{ inputs.gradle-cache-read-only }}

- name: Generate changelog
run: ./gradlew -Pchangelog.githubRepository=${{ github.event.repository.name }} -Pchangelog.futureVersionTag=${{ github.ref_name }} -Pchangelog.sinceTag=${{ github.ref_name }} --stacktrace --info generateChangelog ${{ inputs.gradle-refresh-dependencies && '--refresh-dependencies' || '' }}
shell: bash
working-directory: ${{ inputs.working-directory }}
env:
GITHUB_USER: ${{ github.repository_owner }}
GITHUB_TOKEN: ${{ inputs.github-token }}

- name: Create Github release
uses: softprops/action-gh-release@v1
with:
body_path: CHANGELOG.md
files: ./build/**/*.jar
files: "**/build/libs/*.jar"
22 changes: 11 additions & 11 deletions actions/java-gradle-release/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ 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
Expand Down Expand Up @@ -99,14 +95,18 @@ runs:
shell: bash
working-directory: ${{ inputs.working-directory }}

- name: Push release tag
run: |
git push --tags origin
shell: bash

- name: Create changelog
id: build-changelog
uses: bakdata/ci-templates/actions/[email protected]
with:
github-token: ${{ inputs.github-token }}
new-tag: ${{ steps.evaluate-version.outputs.release-version }}
changelog-file: "${{ inputs.changelog-file }}"
fetch-release-information: "true"
run: ./gradlew -Pchangelog.githubRepository=${{ github.event.repository.name }} -Pchangelog.futureVersionTag=${{ steps.evaluate-version.outputs.release-version }} --stacktrace --info generateChangelog ${{ inputs.gradle-refresh-dependencies && '--refresh-dependencies' || '' }}
shell: bash
working-directory: ${{ inputs.working-directory }}
env:
GITHUB_USER: ${{ github.repository_owner }}
GITHUB_TOKEN: ${{ inputs.github-token }}

- name: Commit and push changes including the bump config file
run: |
Expand Down
14 changes: 10 additions & 4 deletions docs/actions/java-gradle-release-github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,16 @@ steps:

<!-- AUTO-DOC-INPUT:START - Do not remove or modify this section -->

| INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION |
| -------------- | ------ | -------- | ---------------- | --------------------------------------------------- |
| changelog-file | string | false | `"CHANGELOG.md"` | Path to the changelog file in the GitHub repository |
| github-token | string | true | | GitHub token for requesting changes from API. |
| INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION |
| --------------------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| github-token | string | true | | GitHub token for requesting changes from API. |
| gradle-cache | string | false | `"true"` | Whether Gradle caching is enabled or not. (Default is true) |
| gradle-cache-read-only | string | false | `"${{ github.event.repository != null && github.ref_name != github.event.repository.default_branch }}"` | Whether Gradle caching should be read-only. By default this value is 'false' for workflows on the GitHub default branch and 'true' for workflows on other branches. |
| gradle-refresh-dependencies | string | false | `"false"` | Whether Gradle should refresh dependencies. (Default is false) |
| gradle-version | string | false | `"wrapper"` | Gradle version to be installed. (Default is wrapper) |
| java-distribution | string | false | `"microsoft"` | Java distribution to be installed. (Default is microsoft) |
| java-version | string | false | `"11"` | Java version to be installed. (Default is 11) |
| working-directory | string | false | `"."` | Working directory of your Gradle artifacts. (Default is .) |

<!-- AUTO-DOC-INPUT:END -->

Expand Down
1 change: 0 additions & 1 deletion docs/actions/java-gradle-release/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ steps:

| INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION |
| --------------------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| changelog-file | string | false | `"CHANGELOG.md"` | Path to the changelog file in the GitHub repository |
| github-email | string | true | | GitHub email for requesting changes from API. |
| github-token | string | true | | GitHub token for requesting changes from API. |
| github-username | string | true | | GitHub username for requesting changes from API. |
Expand Down
1 change: 0 additions & 1 deletion docs/workflows/java-gradle-docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ No outputs.
| docker-password | true | Password for publishing to Dockerhub. |
| docker-username | true | Username for publishing to Dockerhub. |
| github-token | true | GitHub token for requesting changes from API. |
| github-username | true | GitHub username for requesting changes from API. |
| ossrh-password | true | Password for signing into Sonatype repository. |
| ossrh-username | true | Username for signing into Sonatype repository. |
| signing-key-id | true | Key id for signing the Sonatype publication. |
Expand Down
1 change: 0 additions & 1 deletion docs/workflows/java-gradle-library/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ No outputs.
| SECRET | REQUIRED | DESCRIPTION |
| ----------------------- | -------- | --------------------------------------------------------------- |
| github-token | true | GitHub token for requesting changes from API. |
| github-username | true | GitHub username for requesting changes from API. |
| ossrh-password | true | Password for signing into Sonatype repository. |
| ossrh-username | true | Username for signing into Sonatype repository. |
| signing-key-id | true | Key id for signing the Sonatype publication. |
Expand Down
1 change: 0 additions & 1 deletion docs/workflows/java-gradle-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ No outputs.
| SECRET | REQUIRED | DESCRIPTION |
| ----------------------- | -------- | --------------------------------------------------------------- |
| github-token | true | GitHub token for requesting changes from API. |
| github-username | true | GitHub username for requesting changes from API. |
| gradle-publish-key | true | Key for publishing to Gradle Plugin Portal. |
| gradle-publish-secret | true | Secret for publishing to Gradle Plugin Portal. |
| ossrh-password | true | Password for signing into Sonatype repository. |
Expand Down
Loading