Publish experimental versions to maven

This commit is contained in:
modmuss50
2024-05-17 17:19:25 +01:00
parent 63214b491f
commit 6c7ef44489
2 changed files with 35 additions and 1 deletions

30
.github/workflows/publish-exp.yml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: Publish
on:
push:
branches:
- 'exp/**'
jobs:
build:
runs-on: ubuntu-22.04
container:
image: eclipse-temurin:17-jdk
options: --user root
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2
# Generate the build number based on tags to allow per branch build numbers, not something github provides by default.
- name: Generate build number
id: buildnumber
uses: onyxmueller/build-tag-number@v1
with:
token: ${{ secrets.github_token }}
prefix: "build/exp/${{ github.ref }}"
- run: ./gradlew build publish -x test --stacktrace
env:
MAVEN_URL: ${{ secrets.MAVEN_URL }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
EXPERIMENTAL: true

View File

@@ -53,7 +53,11 @@ def baseVersion = '1.7'
def ENV = System.getenv()
if (ENV.BUILD_NUMBER) {
version = baseVersion + '.' + ENV.BUILD_NUMBER
if (ENV.EXPERIMENTAL) {
version = baseVersion + '.0-alpha.' + ENV.BUILD_NUMBER
} else {
version = baseVersion + '.' + ENV.BUILD_NUMBER
}
} else {
version = baseVersion + '.local'
}