Skip to content

Commit

Permalink
Revert "yes, rico. kaboom."
Browse files Browse the repository at this point in the history
This reverts commit b6ef654.
  • Loading branch information
Nolij committed Sep 30, 2023
1 parent 0be1c1f commit ef33bf0
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 33 deletions.
26 changes: 19 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,27 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: gradle/wrapper-validation-action@v1

- name: Bump Version
run: ./bump_version.sh;
env:
BASE_VERSION: ${{ vars.BASE_VERSION }}
PATCH_VERSION: ${{ vars.PATCH_VERSION }}

- name: Publish to Maven
run: ./gradlew build :felt-spindle:publish -x test --stacktrace;
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}";
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 }}
26 changes: 0 additions & 26 deletions bump_version.sh

This file was deleted.

8 changes: 8 additions & 0 deletions felt-spindle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ 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
} else {
version = baseVersion + '.local'
Expand Down

0 comments on commit ef33bf0

Please sign in to comment.