-
I want to use GitHub Actions to build my java project and upload it to Bintray when creating a new release. Now my question is: Is this even possible? I use gradle and therefore attempted to use the gradle workflow. The gradle.yml I setup looks like this:
The ${{ secrets.[…] }} are setup in the Repository’s Secrets setting. I also use the following build.gradle:
The issue now is that the Action fails at the “Build with Gradle” task with the error "./gradlew: Permission denied Is there any way I could make this work and have GitHub automatically upload (deploy?) the new files to the bintray sites or would I need to search for an alternative? |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments
-
Could you try to chmod +x gradew before you run the script? My guess is the execute bit is not set on that file in the repo. |
Beta Was this translation helpful? Give feedback.
-
So by that you mean changing the gradle.yml to this?
|
Beta Was this translation helpful? Give feedback.
-
No, it sounds like the gradlew script in your repository is not marked as executable. If you’re on a Unix platform, run:
If you’re on Windows, run:
|
Beta Was this translation helpful? Give feedback.
-
I’m now a little bit confused… I did what you said and it seemed to have partially worked. I say partially because it both uploaded files (Even tho I’m not sure if it’s all and if they are uncorrupted/completed and all) to bintray (See first image) but also did throw an error (see second image). Image 1: Image 2: |
Beta Was this translation helpful? Give feedback.
-
From the look of it you’re trying to push/tag a version that already exists? The line saying “Could not create version 2.3.6” seems to indicate that version is conflicting. I’m not familiar with bintray nor gradle, but could it be that you already have a version 2.3.6 uploaded and it only accepts one upload per version? |
Beta Was this translation helpful? Give feedback.
-
It does indeed only accept one release per version. However, I never released a version 2.3.6 before so this shouldn’t be the problem… I’ll update the version and look again. Update: Nope. It used a separate version and it didn’t work. Same error like before. |
Beta Was this translation helpful? Give feedback.
-
Found the issue. GitHub Actions triggered 3 times when I published a new release, causing the first that finished to upload the files (therefore creating the release on bintray) and the other two to fail because it’s already uploaded. Adding the “types: [published]” check to the trigger solved this issue and the CI could finish without errors. |
Beta Was this translation helpful? Give feedback.
No, it sounds like the gradlew script in your repository is not marked as executable.
If you’re on a Unix platform, run:
If you’re on Windows, run: