diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6cb06c0b7..ef489ad1d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ on: jobs: build: # Only run on PRs if the source branch is on someone else's repo - if: ${{ (github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name) && (github.event.name != 'push' || !startsWith(github.event.push.base_ref, 'refs/tags/') || contains(github.event.push.base_ref, '+beta.')) }} + if: ${{ (github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name) && (github.event.name != 'push' || !startsWith(github.ref, 'refs/tags/') || contains(github.ref, '+beta.')) }} runs-on: ubuntu-latest strategy: matrix: @@ -35,38 +35,38 @@ jobs: restore-keys: ${{ runner.os }}-gradle- - name: Build run: ./gradlew build --stacktrace - - name: Determine Release Status + - name: Determine Snapshot Status run: | if [ "$(./gradlew properties | awk '/^version:/ { print $2; }' | grep '\-SNAPSHOT')" ]; then echo "STATUS=snapshot" >> $GITHUB_ENV else echo "STATUS=release" >> $GITHUB_ENV fi - - name: Publish Snapshot - if: "${{ env.STATUS != 'release' && github.event_name == 'push' && github.ref == 'refs/heads/rewrite' }}" - run: ./gradlew publish --stacktrace - env: - ORG_GRADLE_PROJECT_parksUsername: "${{ secrets.CI_USER }}" - ORG_GRADLE_PROJECT_parksPassword: "${{ secrets.CI_PASS }}" - - name: Publish Release - if: "${{ env.STATUS == 'release' && github.event_name == 'release' }}" - run: ./gradlew publish --stacktrace - env: - ORG_GRADLE_PROJECT_parksUsername: "${{ secrets.CI_USER }}" - ORG_GRADLE_PROJECT_parksPassword: "${{ secrets.CI_PASS }}" +# - name: Publish Snapshot to Maven +# if: "${{ env.STATUS != 'release' && github.event_name == 'push' && github.ref == 'refs/heads/2.1' }}" +# run: ./gradlew publish --stacktrace +# env: +# ORG_GRADLE_PROJECT_parksUsername: "${{ secrets.CI_USER }}" +# ORG_GRADLE_PROJECT_parksPassword: "${{ secrets.CI_PASS }}" +# - name: Publish (Pre-)Release to Maven +# if: "${{ env.STATUS == 'release' && github.event_name == 'release' }}" +# run: ./gradlew publish --stacktrace +# env: +# ORG_GRADLE_PROJECT_parksUsername: "${{ secrets.CI_USER }}" +# ORG_GRADLE_PROJECT_parksPassword: "${{ secrets.CI_PASS }}" - name: Parse tag - if: "${{ github.event_name == 'push' && contains(github.event.push.base_ref, '+beta.') }}" + if: "${{ github.event_name == 'push' && contains(github.ref, '+beta.') }}" id: vars run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} - - name: Create release and changelog - if: "${{ github.event_name == 'push' && contains(github.event.push.base_ref, '+beta.') }}" + - name: Create Pre-Release and changelog + if: "${{ github.event_name == 'push' && contains(github.ref, '+beta.') }}" uses: MC-Machinations/auto-release-changelog@v1.1.3 with: token: ${{ secrets.GITHUB_TOKEN }} title: CarbonChat ${{ steps.vars.outputs.tag }} pre-release: true - - name: "Publish Release to Hangar" - if: "${{ env.STATUS == 'release' && (github.event_name == 'release' || (github.event_name == 'push' && contains(github.event.push.base_ref, '+beta.'))) }}" + - name: Publish (Pre-)Release to Hangar + if: "${{ env.STATUS == 'release' && (github.event_name == 'release' || (github.event_name == 'push' && contains(github.ref, '+beta.'))) }}" run: ./gradlew publishAllPublicationsToHangar env: HANGAR_UPLOAD_KEY: "${{ secrets.HANGAR_UPLOAD_KEY }}" diff --git a/gradle.properties b/gradle.properties index 8111fe90d..bc9a68710 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # Project Properties -projectVersion=2.1.0-SNAPSHOT+beta.3 +projectVersion=2.1.0+beta.3 # Gradle Properties org.gradle.configureondemand=true