Skip to content

Commit

Permalink
Revert "kaboom?"
Browse files Browse the repository at this point in the history
This reverts commit 12e7da0.
  • Loading branch information
Nolij committed Sep 30, 2023
1 parent ef33bf0 commit 8cf1af6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 30 deletions.
29 changes: 9 additions & 20 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
12 changes: 2 additions & 10 deletions felt-spindle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Expand Down

0 comments on commit 8cf1af6

Please sign in to comment.