-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b5bc543
commit f6654cb
Showing
11 changed files
with
311 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# java-gradle-test | ||
# java-gradle-setup | ||
|
||
This action sets up Java and Gradle. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# java-maven-build | ||
|
||
This action builds Java artifacts using Maven. | ||
|
||
## Input Parameters | ||
|
||
| Name | Required | Default Value | Type | Description | | ||
| ----------------- | :------: | :-----------: | :----: | -------------------------------------------------------------------------------------------------- | | ||
| maven-version | ✅ | - | string | Maven 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 Maven artifacts | | ||
| command | ❌ | compile | string | Command to run build with | | ||
|
||
## Usage | ||
|
||
```yaml | ||
steps: | ||
- name: Build | ||
uses: bakdata/ci-templates/actions/java-maven-build@main | ||
with: | ||
maven-version: "3.8.2" | ||
java-distribution: "microsoft" # (Optional) | ||
java-version: "11" # (Optional) | ||
working-directory: "." # (Optional) | ||
command: "compile" # (Optional) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: "Build Java artifacts" | ||
description: "Build Java artifacts using Maven" | ||
|
||
inputs: | ||
maven-version: | ||
description: "Maven version to be installed." | ||
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" | ||
working-directory: | ||
description: "Working directory of your Maven artifacts. (Default is .)" | ||
required: false | ||
default: "." | ||
command: | ||
description: "Command to run build with. (Default is compile)" | ||
required: false | ||
default: "compile" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Check out repository | ||
uses: bakdata/ci-templates/actions/[email protected] | ||
|
||
- name: Set up Maven with version ${{ inputs.maven-version }} | ||
uses: bakdata/ci-templates/actions/java-maven-setup1.33.0 | ||
with: | ||
java-distribution: ${{ inputs.java-distribution }} | ||
java-version: ${{ inputs.java-version }} | ||
maven-version: ${{ inputs.maven-version }} | ||
|
||
- name: Compile | ||
run: mvn clean ${{ inputs.command }} | ||
shell: bash | ||
working-directory: ${{ inputs.working-directory }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# java-maven-release | ||
|
||
This action releases Java Maven 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 | | ||
| maven-version | ✅ | - | string | Maven 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 Maven artifacts | | ||
|
||
## Usage | ||
|
||
```yaml | ||
steps: | ||
- name: Release on Github | ||
uses: bakdata/ci-templates/actions/java-maven-release@main | ||
with: | ||
release-type: "patch" | ||
github-email: ${{ secrets.github-email }} | ||
github-username: ${{ secrets.github-username }} | ||
github-token: ${{ secrets.github-token }} | ||
maven-version: "3.8.2" | ||
java-distribution: "microsoft" # (Optional) | ||
java-version: "11" # (Optional) | ||
working-directory: "." # (Optional) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: "Release Java artifacts" | ||
description: "Release Java Maven artifacts on Github" | ||
|
||
inputs: | ||
maven-version: | ||
description: "Maven version to be installed." | ||
required: true | ||
release-type: | ||
description: "Scope of the release" | ||
required: true | ||
github-email: | ||
description: "GitHub email for requesting changes from API." | ||
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 | ||
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" | ||
working-directory: | ||
description: "Working directory of your Maven 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/[email protected] | ||
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 Maven with version ${{ inputs.maven-version }} | ||
uses: bakdata/ci-templates/actions/java-maven-setup1.33.0 | ||
with: | ||
java-distribution: ${{ inputs.java-distribution }} | ||
java-version: ${{ inputs.java-version }} | ||
maven-version: ${{ inputs.maven-version }} | ||
|
||
- name: Bump version | ||
id: evaluate-version | ||
run: | | ||
old_version=$(mvn -Dexec.executable='echo' -Dexec.args='${project.version}' --non-recursive exec:exec -q) | ||
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 | ||
|
||
- name: Create release | ||
run: mvn release:prepare -B -DreleaseVersion=${{ steps.evaluate-version.outputs.release-version }} -Darguments=-DskipTests -Dscm.developer.connection="scm:git:${{ github.server_url }}/${{ github.repository }}.git" | ||
shell: bash | ||
working-directory: ${{ inputs.working-directory }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# java-maven-setup | ||
|
||
This action sets up Java and Maven. | ||
|
||
## Input Parameters | ||
|
||
| Name | Required | Default Value | Type | Description | | ||
| ----------------- | :------: | :-----------: | :----: | -------------------------------------------------------------------------------------------------- | | ||
| maven-version | ✅ | - | string | Maven 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 | | ||
|
||
## Usage | ||
|
||
```yaml | ||
steps: | ||
- name: Set up Maven | ||
uses: bakdata/ci-templates/actions/java-maven-setup@main | ||
with: | ||
maven-version: "3.8.2" | ||
java-distribution: "microsoft" # (Optional) | ||
java-version: "11" # (Optional) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: "Setup Maven" | ||
description: "Setup Java and Maven" | ||
|
||
inputs: | ||
maven-version: | ||
description: "Maven version to be installed." | ||
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" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: ${{ inputs.java-distribution }} | ||
java-version: ${{ inputs.java-version }} | ||
|
||
- name: Set up Maven | ||
uses: yuzhiyongcn/[email protected] | ||
with: | ||
maven-version: ${{ inputs.maven-version }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# java-maven-test | ||
|
||
This action runs Junit tests and publishes the test results. | ||
|
||
## Input Parameters | ||
|
||
| Name | Required | Default Value | Type | Description | | ||
| ------------------ | :------: | :-----------: | :-----: | -------------------------------------------------------------------------------------------------- | | ||
| maven-version | ✅ | - | string | Maven 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 Maven artifacts | | ||
| download-lfs-files | ❌ | false | boolean | Whether the Git checkout action should resolve LFS files or not | | ||
| command | ❌ | test | string | Command to run tests with | | ||
|
||
## Usage | ||
|
||
```yaml | ||
steps: | ||
- name: Test | ||
uses: bakdata/ci-templates/actions/java-maven-test@main | ||
with: | ||
maven-version: "3.8.2" | ||
java-distribution: "microsoft" # (Optional) | ||
java-version: "11" # (Optional) | ||
working-directory: "." # (Optional) | ||
command: "test" # (Optional) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: "Test Java artifacts" | ||
description: "Run Junit test and publish test results" | ||
|
||
inputs: | ||
maven-version: | ||
description: "Maven version to be installed." | ||
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" | ||
working-directory: | ||
description: "Working directory of your Maven artifacts. (Default is .)" | ||
required: false | ||
default: "." | ||
download-lfs-files: | ||
description: "Whether the Git checkout action should resolve LFS files or not. (Default is false)" | ||
required: false | ||
default: false | ||
command: | ||
description: "Command to run tests with. (Default is test)" | ||
required: false | ||
default: "test" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Check out repository | ||
uses: bakdata/ci-templates/actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
lfs: ${{ inputs.download-lfs-files }} | ||
|
||
- name: Set up Maven with version ${{ inputs.maven-version }} | ||
uses: bakdata/ci-templates/actions/java-maven-setup1.33.0 | ||
with: | ||
java-distribution: ${{ inputs.java-distribution }} | ||
java-version: ${{ inputs.java-version }} | ||
maven-version: ${{ inputs.maven-version }} | ||
|
||
- name: Run tests | ||
run: mvn ${{ inputs.command }} | ||
shell: bash | ||
working-directory: ${{ inputs.working-directory }} |