Make running shell configurable

This commit is contained in:
Andres Almiray 2022-02-02 19:33:02 +01:00
parent f4b19f681f
commit 7feb30071b
No known key found for this signature in database
GPG key ID: CCC55C5167419ADB
2 changed files with 22 additions and 4 deletions

View file

@ -63,6 +63,17 @@ jobs:
uses: jreleaser/release-action@v2 uses: jreleaser/release-action@v2
env: env:
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Persist logs
- name: JReleaser release output
if: always()
uses: actions/upload-artifact@v2
with:
name: jreleaser-release
path: |
out/jreleaser/trace.log
out/jreleaser/output.properties
---- ----
WARNING: Note the `fetch-depth: 0` option on the `Checkout` workflow step. It is required for JReleaser to work properly. WARNING: Note the `fetch-depth: 0` option on the `Checkout` workflow step. It is required for JReleaser to work properly.
@ -88,6 +99,9 @@ Following inputs can be used as `step.with` keys
Should match any of the link:https://github.com/jreleaser/jreleaser/releases[published releases]. + Should match any of the link:https://github.com/jreleaser/jreleaser/releases[published releases]. +
You may use `latest` to pull the latest stable release or + You may use `latest` to pull the latest stable release or +
`early-access` to pull the latest snapshot. `early-access` to pull the latest snapshot.
| shell | String | bash | The shell used to run JReleaser. +
Refer to the link:https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell[official docs]
to learn more about the different shell types.
| arguments | String | full-release | The JReleaser command to run. | arguments | String | full-release | The JReleaser command to run.
| working-directory | String | ${{ github.workspace }} | The directory to change into. + | working-directory | String | ${{ github.workspace }} | The directory to change into. +
Defaults to the directory the calling workflow runs in. Defaults to the directory the calling workflow runs in.

View file

@ -7,12 +7,16 @@ branding:
color: 'gray-dark' color: 'gray-dark'
inputs: inputs:
version: version:
description: 'The version of JReleaser to download and execute.' description: 'The version of JReleaser to download and execute.'
default: 'latest' default: 'latest'
required: true required: true
shell:
description: 'The shell used to run JReleaser.'
default: 'bash'
required: false
arguments: arguments:
description: 'The command-line arguments to be passed to JReleaser.' description: 'The command-line arguments to be passed to JReleaser.'
default: 'full-release' default: 'full-release'
@ -24,16 +28,16 @@ inputs:
description: 'The directory to change into.' description: 'The directory to change into.'
setup-java: setup-java:
required: false
default: 'true' default: 'true'
description: 'Setup internal Java runtime.' description: 'Setup internal Java runtime.'
required: false
runs: runs:
using: 'composite' using: 'composite'
steps: steps:
- name: 'Setup Java' - name: 'Setup Java'
uses: actions/setup-java@v2 uses: actions/setup-java@v2
if: ${{ inputs.setup-java }} == 'true' if: ${{ inputs.setup-java }} == 'true' || ${{ inputs.setup-java }} == true
with: with:
java-version: 17 java-version: 17
distribution: 'zulu' distribution: 'zulu'
@ -48,7 +52,7 @@ runs:
echo "::endgroup::" echo "::endgroup::"
- name: 'Execute JReleaser' - name: 'Execute JReleaser'
shell: bash shell: ${{ inputs.shell }}
working-directory: ${{ inputs.working-directory }} working-directory: ${{ inputs.working-directory }}
run: | run: |
echo "☕ java -jar jreleaser-cli.jar ${{ inputs.arguments }}" echo "☕ java -jar jreleaser-cli.jar ${{ inputs.arguments }}"