diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 962e6669..32556ba1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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" @@ -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 diff --git a/build.gradle b/build.gradle index 58c7cd41..1e2575f4 100644 --- a/build.gradle +++ b/build.gradle @@ -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() }