Skip to content
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
21 changes: 10 additions & 11 deletions .github/workflows/gradle-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ on:
type: string
default: ''

fetch_all_commits:
description: 'Whether to fetch all commits. Default: false'
required: false
type: boolean
default: false

secrets:
SONATYPE_USERNAME:
required: true
Expand Down Expand Up @@ -66,7 +60,7 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: '${{ env.FINAL_REF }}'
fetch-depth: ${{ inputs.fetch_all_commits == true && '0' || '1' }}
fetch-depth: 0
persist-credentials: false
fetch-tags: true

Expand Down Expand Up @@ -124,11 +118,16 @@ jobs:

- name: Create the GH Release
run: |
# Fetch latest two tags sorted by creation date
TAGS=$(git tag --sort=-creatordate | head -n 2)
# Fetch latest two tags merged into the target ref sorted by creation date
TAGS=$(git tag --sort=-creatordate --merged "${FINAL_REF}" | head -n 2)
LATEST_TAG=$(echo "$TAGS" | sed -n '1p')
PREVIOUS_TAG=$(echo "$TAGS" | sed -n '2p')
echo "Creating release notes between ${LATEST_TAG} and ${PREVIOUS_TAG}"
gh release create --target "${FINAL_REF}" --generate-notes --notes-start-tag "${PREVIOUS_TAG}" "${LATEST_TAG}"
if [ -n "${PREVIOUS_TAG}" ]; then
echo "Creating release notes between ${LATEST_TAG} and ${PREVIOUS_TAG}"
gh release create --target "${FINAL_REF}" --generate-notes --notes-start-tag "${PREVIOUS_TAG}" "${LATEST_TAG}"
else
echo "Creating release notes for ${LATEST_TAG}"
gh release create --target "${FINAL_REF}" --generate-notes "${LATEST_TAG}"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22 changes: 11 additions & 11 deletions .github/workflows/maven-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ on:
# We'll manually push it later
default: 'mvn -B -V release:prepare release:perform -DlocalCheckout=true -DpushChanges=false -DcompletionGoals="spotless:apply"'

fetch_all_commits:
description: 'Whether to fetch all commits. Default: false'
required: false
type: boolean
default: false
quarkus_jib_image:
description: 'Whether to perform a Quarkus JIB image build and push. Default: false'
required: false
Expand Down Expand Up @@ -78,13 +73,13 @@ jobs:

env:
# Logic: Use the user input if provided, otherwise fall back to the repo's default branch
FINAL_REF: ${{ github.event.inputs.ref_to_release || github.event.repository.default_branch }}
FINAL_REF: ${{ inputs.ref_to_release || github.event.repository.default_branch }}

steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: '${{ env.FINAL_REF }}'
fetch-depth: ${{ inputs.fetch_all_commits == true && '0' || '1' }}
fetch-depth: 0
persist-credentials: false
fetch-tags: true

Expand Down Expand Up @@ -145,12 +140,17 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create the GH Release
run: |
# Fetch latest two tags sorted by creation date
TAGS=$(git tag --sort=-creatordate --merged "$FINAL_REF" | head -n 2)
# Fetch latest two tags merged into the target ref sorted by creation date
TAGS=$(git tag --sort=-creatordate --merged "${FINAL_REF}" | head -n 2)
LATEST_TAG=$(echo "$TAGS" | sed -n '1p')
PREVIOUS_TAG=$(echo "$TAGS" | sed -n '2p')
echo "Creating release notes between ${LATEST_TAG} and ${PREVIOUS_TAG}"
gh release create --target "${FINAL_REF}" --generate-notes --notes-start-tag "${PREVIOUS_TAG}" "${LATEST_TAG}"
if [ -n "${PREVIOUS_TAG}" ]; then
echo "Creating release notes between ${LATEST_TAG} and ${PREVIOUS_TAG}"
gh release create --target "${FINAL_REF}" --generate-notes --notes-start-tag "${PREVIOUS_TAG}" "${LATEST_TAG}"
else
echo "Creating release notes for ${LATEST_TAG}"
gh release create --target "${FINAL_REF}" --generate-notes "${LATEST_TAG}"
fi
env:
# Use the standard GITHUB_TOKEN or a Custom PAT if pushing to other repos
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11 changes: 3 additions & 8 deletions .github/workflows/sbt-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ on:
"MRRC" at "https://maven.repository.redhat.com/ga/"
)

fetch_all_commits:
description: "Whether to fetch all commits. Default: false"
required: false
type: boolean
default: false

secrets:
SONATYPE_USERNAME:
required: true
Expand Down Expand Up @@ -87,7 +81,7 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: "${{ env.FINAL_REF }}"
fetch-depth: ${{ inputs.fetch_all_commits == true && '0' || '1' }}
fetch-depth: 0
persist-credentials: false
fetch-tags: true

Expand Down Expand Up @@ -152,7 +146,8 @@ jobs:

- name: Create the GH Release
run: |
TAGS=$(git tag --sort=-creatordate | head -n 2)
# Fetch latest two tags merged into the target ref sorted by creation date
TAGS=$(git tag --sort=-creatordate --merged "${FINAL_REF}" | head -n 2)
LATEST_TAG=$(echo "$TAGS" | sed -n '1p')
PREVIOUS_TAG=$(echo "$TAGS" | sed -n '2p')
if [ -n "${PREVIOUS_TAG}" ]; then
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ Releases <= v0.0.24 are compatible with `jboss-parent` <= v53. v0.0.25 upward re
* ref_to_release (default: `''`)
* java_version (default: `21`)
* release_command (default `mvn -B -V release:prepare release:perform -DlocalCheckout=true -DpushChanges=false`)
* fetch_all_commits (default: `false`)
* jboss_parent_override: This is used to override variables from the jboss-parent (default `-Dcentral.serverId=central-publisher -Dcentral.autoPublish=false -DreleaseProfile=central-release -DsignTag=false`)
- **Permissions**: `contents: write`

Expand Down Expand Up @@ -287,7 +286,6 @@ environment variables. The publish task must also be wired into the Gradle relea
* `ref_to_release` (default: `''`): Branch or commit to release
* `java_version` (default: `17`)
* `release_args` (default: `release`)
* `fetch_all_commits` (default: `false`)
- **Secrets**: `SONATYPE_USERNAME`, `SONATYPE_PASSWORD`, `GPG_PRIVATE_KEY`, `GPG_PASSPHRASE`
- **Permissions**: `contents: write`

Expand Down Expand Up @@ -388,7 +386,6 @@ in `version.sbt` (the file updated by `sbt-release`).
* `additional_release_args` (default: `''`): Extra `sbt-release` arguments, e.g. `skip-tests`
* `java_version` (default: `8`)
* `resolvers` (default: same as `sbt-ci.yml`)
* `fetch_all_commits` (default: `false`)
- **Secrets**: `SONATYPE_USERNAME`, `SONATYPE_PASSWORD`, `GPG_PRIVATE_KEY`, `GPG_PASSPHRASE`
- **Permissions**: `contents: write`

Expand Down