From e3dc75d8b08e58ad078a19fdc014eb243f0965f1 Mon Sep 17 00:00:00 2001 From: darksaid98 Date: Tue, 28 May 2024 15:50:26 +0200 Subject: [PATCH] ci: don't publish snapshot on release --- .github/workflows/release.yml | 3 +++ .github/workflows/tests.yml | 19 ++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7c5f507..ee42093 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,6 +16,9 @@ jobs: tests: name: Run Tests uses: ./.github/workflows/tests.yml + secrets: inherit + with: + publish_snapshot: false release: name: Create Release strategy: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 23bc2c1..0ffc720 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,6 +7,16 @@ on: - 'master' workflow_dispatch: workflow_call: + secrets: + MAVEN_NAME: + required: false + MAVEN_PASSWORD: + required: false + inputs: + publish_snapshot: + required: false + default: true + type: boolean permissions: contents: write @@ -43,9 +53,16 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} default-bump: patch + # Build with Gradle - name: Build with Gradle + if: ${{ inputs.publish_snapshot == false }} + run: ./gradlew clean build -PcustomVersion=${{ steps.version.outputs.version }}-SNAPSHOT-${{ github.run_number }} --info + + # Build with Gradle + - name: Build with Gradle + if: ${{ inputs.publish_snapshot == true }} run: ./gradlew clean build publishAllPublicationsToSnapshotsRepository -PcustomVersion=${{ steps.version.outputs.version }}-SNAPSHOT-${{ github.run_number }} --info env: MAVEN_USERNAME: ${{ secrets.MAVEN_NAME }} - MAVEN_PASSWORD: ${{ secrets.MAVEN_SECRET }} + MAVEN_PASSWORD: ${{ secrets.MAVEN_SECRET }} \ No newline at end of file