From 8cf1af6742d498ff9341c81c39f0c7dfab047f21 Mon Sep 17 00:00:00 2001 From: Nolij Date: Sat, 30 Sep 2023 13:47:41 -0400 Subject: [PATCH] Revert "kaboom?" This reverts commit 12e7da0b09a72dacc850ccae6197d44816425c46. --- .github/workflows/publish.yml | 29 +++++++++-------------------- felt-spindle/build.gradle | 12 ++---------- 2 files changed, 11 insertions(+), 30 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 47ebd06..6eb2a47 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,26 +14,15 @@ jobs: - uses: actions/checkout@v3 - uses: gradle/wrapper-validation-action@v1 - - name: Publish to Maven - run: | - ./gradlew build :felt-spindle:publish -x test --stacktrace; - gh api \ - --method PATCH \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - ${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/actions/variables/BASE_VERSION \ - -f name='BASE_VERSION' \ - -f value="${BASE_VERSION}"; - gh api \ - --method PATCH \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - ${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/actions/variables/PATCH_VERSION \ - -f name='PATCH_VERSION' \ - -f value="${PATCH_VERSION}"; + # 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/${{ github.ref }}" + + - run: ./gradlew build :felt-spindle:publish -x test --stacktrace env: - CI: true - BASE_VERSION: ${{ vars.BASE_VERSION }} - PATCH_VERSION: ${{ vars.PATCH_VERSION }} MAVEN_USERNAME: ${{ secrets.MAVEN_PUBLISH_USERNAME }} MAVEN_PASSWORD: ${{ secrets.MAVEN_PUBLISH_TOKEN }} \ No newline at end of file diff --git a/felt-spindle/build.gradle b/felt-spindle/build.gradle index 3aab535..ae88ec5 100644 --- a/felt-spindle/build.gradle +++ b/felt-spindle/build.gradle @@ -9,16 +9,8 @@ archivesBaseName = project.name def baseVersion = project.base_version def ENV = System.getenv() -if (ENV.CI) { - if (!ENV.BASE_VERSION) { - ENV.BASE_VERSION = baseVersion - ENV.PATCH_VERSION = 0 - } else if (!ENV.PATCH_VERSION || ENV.BASE_VERSION != baseVersion) { - ENV.PATCH_VERSION = 0 - } else { - ENV.PATCH_VERSION = Integer.parseInt(ENV.PATCH_VERSION) + 1 - } - version = baseVersion + ENV.PATCH_VERSION +if (ENV.BUILD_NUMBER) { + version = baseVersion + '.' + ENV.BUILD_NUMBER } else { version = baseVersion + '.local' }