Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix the SCM versioning pipeline #76

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

Merged
merged 5 commits into from
Aug 2, 2023
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
19 changes: 15 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3 # TODO: with... bot?
with:
fetch-depth: 0
fetch-depth: 0 # Due to https://axion-release-plugin.readthedocs.io/en/latest/configuration/ci_servers/#github-actions

- name: "Fetch git tags" # Required for axion-release-plugin
run: git fetch --tags

- name: Set up JDK 17
uses: actions/setup-java@v3
Expand All @@ -43,9 +46,14 @@ jobs:
git config user.email 'github-actions[bot]@users.noreply.github.com'
./gradlew release

- name: Show post-release version
run: ./gradlew currentVersion

# The previous "Release new version" step increases the version. We need this version for the publishing job. The
# currentVersion command gets this value, which we store in the "version" variable for following jobs.
- name: Get current version
# The $GITHUB_OUTPUT is a github-magic "file", it is accessible with needs.github.outputs.[variable-name], in our
# case: needs.github.outputs.version
- name: Store version
id: version
run: echo "VERSION=$(./gradlew -q -Prelease.quiet currentVersion)" >> "$GITHUB_OUTPUT"

Expand All @@ -57,8 +65,11 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: refs/tags/${{ needs.github.outputs.VERSION }}
fetch-depth: 0 # Due to https://axion-release-plugin.readthedocs.io/en/latest/configuration/ci_servers/#github-actions
ref: refs/tags/${{ needs.github.outputs.VERSION }} # Checkout the new created tag

- name: "Fetch git tags" # Required for axion-release-plugin
run: git fetch --tags

- name: Set up JDK 17
uses: actions/setup-java@v3
Expand Down
10 changes: 9 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@ plugins {
}

group 'io.securecodebox'
version = scmVersion.version
sourceCompatibility = '17'

scmVersion {
tag {
prefix.set('') // Remove the plugin's default "v" tag prefix
}

useHighestVersion.set(true) // https://axion-release-plugin.readthedocs.io/en/latest/configuration/version/#tag-with-the-highest-version
}
version = scmVersion.version

repositories {
mavenCentral()
}
Expand Down