-
Notifications
You must be signed in to change notification settings - Fork 157
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
release fails with ReleaseFailedException: Status: Optional[REJECTED_OTHER_REASON] #878
Comments
hi! without your whole workflow/setup it's hard to help, is it reproducable locally? whats the origin git repo? |
I was running it in GitHub Action, and it was failing. ./gradlew \
-Prelease.forceVersion=0.3.0 \
-Prelease.customUsername=$GH_USER \
-Prelease.customPassword=$GH_TOKEN \
release --stacktrace Locally with the same command I got above errors, and also this error:
The problem is that the message is to verbose. I can't find what is wrong. But the wired thing is, that if I run it again, it is not failing. My workaround for that is run this command localy, and than publish it using For the record, my GitHub workflow looks like this: name: Release version
on:
workflow_dispatch:
inputs:
new-release-version:
description: Release version
required: false
type: string
jobs:
library-release:
name: Run release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
- name: Set up JDK
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
with:
distribution: temurin
java-version: 21
check-latest: true
- name: Setup Gradle
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2
with:
add-job-summary-as-pr-comment: never
gradle-version: wrapper
validate-wrappers: true
- name: Version to release
shell: bash
run: |
if [ "${{ inputs.new-release-version }}" = "" ];
then
echo "Release will increase PATCH version";
else
echo "Release version provided by user: ${{ inputs.new-release-version }}";
fi
- name: Release version
shell: bash
run: |
./gradlew \
-Prelease.forceVersion=${{ inputs.new-release-version }} \
-Prelease.customUsername=${{ github.actor }} \
-Prelease.customPassword=${{ github.token }} \
release --stacktrace
- name: Released version
shell: bash
run: |
./gradlew currentVersion
- name: Publish package
shell: bash
run: |
./gradlew publish |
can you check if running this before the release step helps?
other things I noticed:
I would recommend using github releases, you'll have cleaner workflow and ability to actually write release notes why you're releasing new version instead of:
jest enable repo unshallow https://github.com/allegro/axion-release-plugin/releases/tag/v1.18.4 Running
is not needed, since it triggers another build run, instead use step outputs https://axion-release-plugin.readthedocs.io/en/latest/configuration/ci_servers/#github-outputs |
I will try with this fetch. But I found that the error is only when I force the version. When I'm not passing the version, and patch number is increased it is working. But can you do something to add more data from plugin exception? Thanks for your tips about fetch and Gradle current version, I can't apply it now, because we are using this workflow as reusable, and not every project is using latest version the plugin. But can you share a link with me about github releases you are talking about? |
You can trigger maven publication after release https://github.com/bgalek/safe-svg/blob/main/.github/workflows/publish.yml Having reusable workflow with so many things and steps seems very fragile and hard to work with, I would recommend using init-script instead: https://www.linkedin.com/events/7211676201914904578/about/ You can than remove axion dependency from all other repositories ;) |
Hmm, the problem is that I also don't know. And thought that
Yeah, but first I need to trigger it. So you are suggesting that I should split it into two workflows - one for releasing, and second for publishing, and I think you are right.
Thanks for the link, I will watch it soon.
So, you are saying that in Allegro you are not using it anymore? Or you meant Gradle Conventional plugin, and put it there? |
Here is log from GH Action:
And actually the tag |
I tried to add:
and found that So I added this instead:
And after that I got more info in stack trace:
And again tag was created. |
We use it once in our init.gradle script, so nobody needs to depend on it and simple |
I would recommend sticking to standard library flow |
assiming: name: Service Release
on:
pull_request:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
outputs:
released-version: ${{ steps.release.outputs.released-version }} # optional if you want to log it or smth
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '23'
distribution: 'temurin'
- uses: gradle/actions/setup-gradle@v4
- run: ./gradlew build
- run: ./gradlew release
id: release
- run: ./gradlew publish name: Library Release
on:
release:
types: [ created ]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '23'
distribution: 'temurin'
- uses: gradle/actions/setup-gradle@v4
- run: ./gradlew publish |
@bgalek thanks for the tips with workflow. But I would like to try to find the cause.
|
@bgalek do you have any thought on it? |
If adding --stracktrace or --debug to Gradle task isn't enough - fork the repository and try to add more logging. I'll be happy to help if you provide me a repository that shows the problem. Could you prepare that? |
I'm using plugin
v1.18.16
with Gradle 8.11.1 and runrelease
task with--stacktrace
option. But the exception message do not show nothing helpful. I'm getting:Release fails with
Message is empty, nothing else can be found.
on some runs it is:
On other projects it is working, the gradle configuration is the same.
The only difference is that I changed the repository name.
Any thought what it can be?
The text was updated successfully, but these errors were encountered: