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

Use generate-changelog action in java-gradle-release #146

Merged
merged 31 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
06d0a6e
Initial commit
MichaelKora Sep 21, 2023
57854f7
Update changelog generation
MichaelKora Sep 21, 2023
19cb784
Clean code and revert changes in the build action
MichaelKora Sep 22, 2023
3e6c672
Add publish
MichaelKora Sep 27, 2023
bc5e78a
Test the tmp dir
MichaelKora Sep 28, 2023
e1a211a
Test the tmp dir
MichaelKora Sep 28, 2023
dbe3680
Test the tmp dir
MichaelKora Sep 28, 2023
f09201e
Test the tmp dir
MichaelKora Sep 28, 2023
36089ca
Test the tmp dir
MichaelKora Sep 28, 2023
8f8e3cd
Test the tmp dir
MichaelKora Sep 28, 2023
85a46a4
Clean code
MichaelKora Sep 28, 2023
675181a
Test with automatic changelog branch
disrupted Sep 28, 2023
2c84b8f
Fix string
disrupted Sep 28, 2023
0d9840e
Update version and clean code
MichaelKora Sep 29, 2023
d078e0d
Merge branch 'feat/gradle-release' of github.com:bakdata/ci-templates…
MichaelKora Sep 29, 2023
60f9238
Clean code
MichaelKora Sep 29, 2023
42e6b2c
Clean code
MichaelKora Sep 29, 2023
206b1aa
Update the java gradle release github action
MichaelKora Oct 4, 2023
df0904e
Merge branch 'main' into feat/gradle-release
MichaelKora Oct 4, 2023
721630a
Sort vars
MichaelKora Oct 4, 2023
fe6e1d3
Remove gradle setup action from the gradle release gh
MichaelKora Oct 4, 2023
7b34e01
Update documentation
MichaelKora Oct 6, 2023
f7c4acc
Add gh release
MichaelKora Oct 6, 2023
a7c3db6
Allow to push tag
MichaelKora Oct 9, 2023
56a2bfd
Allow to push tag
MichaelKora Oct 9, 2023
7d09a7c
Test changelog
MichaelKora Oct 9, 2023
38cc4a5
Test changelog
MichaelKora Oct 9, 2023
b0371b4
Update tags
MichaelKora Oct 9, 2023
e799326
Merge remote-tracking branch 'origin/main' into feat/gradle-release
MichaelKora Oct 9, 2023
9c9da5d
Merge remote-tracking branch 'origin/main' into feat/gradle-release
MichaelKora Oct 9, 2023
8da7a4e
Tag next release version
MichaelKora Oct 11, 2023
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
29 changes: 18 additions & 11 deletions .github/workflows/java-gradle-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,22 @@ on:
description: "Scope of the release (major, minor or patch)."
required: true
type: string

MichaelKora marked this conversation as resolved.
Show resolved Hide resolved
changelog-file:
MichaelKora marked this conversation as resolved.
Show resolved Hide resolved
yannick-roeder marked this conversation as resolved.
Show resolved Hide resolved
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
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
Expand All @@ -18,16 +34,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
Expand Down Expand Up @@ -62,9 +68,10 @@ 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@1.35.2
MichaelKora marked this conversation as resolved.
Show resolved Hide resolved
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
19 changes: 10 additions & 9 deletions actions/java-gradle-release-github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
19 changes: 12 additions & 7 deletions actions/java-gradle-release-github/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -48,13 +52,14 @@ runs:
gradle-version: ${{ inputs.gradle-version }}
gradle-cache: ${{ inputs.gradle-cache }}
MichaelKora marked this conversation as resolved.
Show resolved Hide resolved

- 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/[email protected]
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
Expand Down
23 changes: 12 additions & 11 deletions actions/java-gradle-release/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" | 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

Expand Down
49 changes: 28 additions & 21 deletions actions/java-gradle-release/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,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
Expand All @@ -22,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
Expand Down Expand Up @@ -86,17 +90,20 @@ runs:
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: 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"

- 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 }}
MichaelKora marked this conversation as resolved.
Show resolved Hide resolved
shell: bash
- name: Commit and push changes including the bump config file
uses: bakdata/ci-templates/actions/[email protected]
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 }}