From 2b9c717952edaa50e789929c605c09df0b90725b Mon Sep 17 00:00:00 2001 From: palexdev Date: Sat, 8 Jun 2024 00:49:25 +0200 Subject: [PATCH] :construction_worker: Update gradle.yml Signed-off-by: palexdev --- .github/workflows/gradle.yml | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 90ca9766..b736d415 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -10,18 +10,49 @@ on: branches: [ rewrite ] jobs: - build: + # Only if last commit does not contain [RELEASE] + check: + runs-on: windows-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Get Last Commit + run: | + $val = git show --pretty=format:"%s" -s HEAD + echo "MESSAGE=$val" >> $env.GITHUB_ENV + shell: pwsh + + - name: Check Last Commit + id: check_commit + run: | + if ($env:LAST_COMMIT_TITLE -match '\[RELEASE\]') { + echo "::set-output name=executable::true" + } else { + echo "::set-output name=executable::false" + } + shell: pwsh + outputs: + executable: ${{ steps.check_commit.outputs.executable }} + + build: runs-on: windows-latest + needs: check + if: ${{ needs.check.outputs.executable == 'false' }} steps: - - uses: actions/checkout@v3 + - name: Checkout code + uses: actions/checkout@v3 + - name: Set up JDK 21 uses: actions/setup-java@v3 with: distribution: 'zulu' java-version: '21' + - name: Grant execute permission for gradlew run: chmod +x gradlew + - name: Build with Gradle run: ./gradlew build -x test -x processCSS