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

add release related outputs and allow specifying custom ref to check out #46

Merged
merged 2 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .github/workflows/gradle-library-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ on:
description: If JUnit test results are expected
default: true
type: boolean
checkout-ref:
description: Custom ref to check out
type: string
default: ''
secrets:
WETF_ARTIFACTORY_USER:
WETF_ARTIFACTORY_PASSWORD:
Expand All @@ -30,5 +34,6 @@ jobs:
java-version: ${{ inputs.java-version }}
multi-module: ${{ inputs.multi-module }}
expect-tests: ${{ inputs.expect-tests }}
checkout-ref: ${{ inputs.checkout-ref }}
notify-failure: false
secrets: inherit
12 changes: 12 additions & 0 deletions .github/workflows/gradle-library-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ on:
description: If JUnit test results are expected
default: true
type: boolean
checkout-ref:
description: Custom ref to check out
type: string
default: ''
semantic-release:
description: State if a release should be created using semantic-release if applicable
default: false
Expand All @@ -31,6 +35,13 @@ on:
description: If semantic release should do a dryrun
default: false
type: boolean
outputs:
release-published:
description: If a release was created
value: ${{ jobs.publish.outputs.release-published }}
release-version:
description: The release version if a release was created
value: ${{ jobs.publish.outputs.release-version }}
secrets:
WETF_ARTIFACTORY_USER:
WETF_ARTIFACTORY_PASSWORD:
Expand All @@ -47,6 +58,7 @@ jobs:
java-version: ${{ inputs.java-version }}
multi-module: ${{ inputs.multi-module }}
expect-tests: ${{ inputs.expect-tests }}
checkout-ref: ${{ inputs.checkout-ref }}
semantic-release: ${{ inputs.semantic-release }}
semantic-release-dryrun: ${{ inputs.semantic-release-dryrun }}
secrets: inherit
17 changes: 17 additions & 0 deletions .github/workflows/gradle-library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,17 @@ on:
description: If this is a multi-module project
type: boolean
default: false
checkout-ref:
description: Custom ref to check out
type: string
default: ''
outputs:
release-published:
description: If a release was created
value: ${{ jobs.run.outputs.release-published }}
release-version:
description: The release version if a release was created
value: ${{ jobs.run.outputs.release-version }}
secrets:
# GH_PAT:
# required: true
Expand All @@ -78,10 +89,15 @@ jobs:
run:
runs-on: ubuntu-latest

outputs:
release-published: ${{ steps.gradle-release.outputs.release-published }}
release-version: ${{ steps.gradle-release.outputs.release-version }}

steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: ${{ inputs.checkout-ref }}
submodules: ${{ inputs.submodules }}
# do not persist credentials because this clashes with semantic-release action
# (because the @semantic-release/git attempts to use them but needs permissions to bypass protection)
Expand Down Expand Up @@ -181,6 +197,7 @@ jobs:
private-key: "${{ secrets.WE_RELEASE_GITHUB_PRIVATE_KEY }}"

- name: Publish/release with Gradle
id: gradle-release
if: ${{ !inputs.skip-build && inputs.publish-tasks != '' }}
uses: wetransform/gha-gradle-semantic-release@7df5afac738e0cf1ffb38917c17a6c4a5357a5af # v2.1.0
with:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/gradle-service-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ on:
description: If JUnit test results are expected
default: true
type: boolean
checkout-ref:
description: Custom ref to check out
type: string
default: ''
secrets:
# GH_PAT:
# required: true
Expand All @@ -51,5 +55,6 @@ jobs:
image-tag-3: ${{ inputs.image-tag-3 }}
multi-module: ${{ inputs.multi-module }}
expect-tests: ${{ inputs.expect-tests }}
checkout-ref: ${{ inputs.checkout-ref }}
notify-failure: false
secrets: inherit
5 changes: 5 additions & 0 deletions .github/workflows/gradle-service-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ on:
description: If JUnit test results are expected
default: true
type: boolean
checkout-ref:
description: Custom ref to check out
type: string
default: ''
secrets:
# GH_PAT:
# required: true
Expand All @@ -55,4 +59,5 @@ jobs:
image-tag-3: ${{ inputs.image-tag-3 }}
multi-module: ${{ inputs.multi-module }}
expect-tests: ${{ inputs.expect-tests }}
checkout-ref: ${{ inputs.checkout-ref }}
secrets: inherit
5 changes: 5 additions & 0 deletions .github/workflows/gradle-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ on:
description: If this is a multi-module project
type: boolean
default: false
checkout-ref:
description: Custom ref to check out
type: string
default: ''
secrets:
# GH_PAT:
# required: true
Expand All @@ -51,6 +55,7 @@ jobs:
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: ${{ inputs.checkout-ref }}
# fetch-depth 0 is required to fetch all tags (and to determine the version based on tags)
fetch-depth: 0
# TODO similar to gradle-library:
Expand Down
Loading