diff --git a/.gitea/workflows/gradle-publish.yaml b/.gitea/workflows/gradle-publish.yaml index f6d4da8..e0ec879 100644 --- a/.gitea/workflows/gradle-publish.yaml +++ b/.gitea/workflows/gradle-publish.yaml @@ -1,11 +1,11 @@ -name: Test +name: Publish on: push: - branches: [master] + branches: [master, dev] jobs: - Gradle-Test: + Gradle-Publish: runs-on: ubuntu-latest steps: @@ -34,7 +34,14 @@ jobs: restore-keys: | ${{ runner.os }}-gradle- - - name: Publish + - name: Publish Release + if: ${{ github.ref == '/refs/heads/master' }} + env: + GITEA_TOKEN: ${{ secrets.PUBLISH_PACKAGE_TOKEN }} + run: chmod +x gradlew; ./gradlew publishAllPublicationsToGiteaRepository -Prelease + + - name: Publish Dev + if: ${{ github.ref == '/refs/heads/dev' }} env: GITEA_TOKEN: ${{ secrets.PUBLISH_PACKAGE_TOKEN }} run: chmod +x gradlew; ./gradlew publishAllPublicationsToGiteaRepository \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index ef41a19..c821828 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,6 +8,7 @@ allprojects { group = "net.tomatentum.Marinara" version = "1.0.0-RC1" + (if (!project.hasProperty("release")) ("-" + getGitHash()) else "") description = "A simple but powerful, library-agnostic Discord Interaction Wrapper." + } subprojects { @@ -18,6 +19,8 @@ subprojects { publishing { publications { create("maven") { + if (!project.hasProperty("release")) + artifactId = project.getName() + "-dev" from(components["java"]) } }