Merge branch 'v3' of https://github.com/objz/CommandBridge into v3 #90
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build CommandBridge | |
| on: | |
| push: | |
| branches: ["v3"] | |
| pull_request: | |
| branches: ["v3"] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: build-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: "21" | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Make gradlew executable | |
| run: chmod +x ./gradlew | |
| - name: Build shadow JAR (PR) | |
| if: github.event_name == 'pull_request' | |
| run: ./gradlew shadowJar --no-daemon | |
| - name: Get short SHA | |
| if: github.event_name != 'pull_request' | |
| id: vars | |
| shell: bash | |
| run: echo "sha8=${GITHUB_SHA::8}" >> "$GITHUB_OUTPUT" | |
| - name: Build shadow JAR (Push/Dispatch) | |
| if: github.event_name != 'pull_request' | |
| run: ./gradlew shadowJar -PbuildVersion="dev-${{ steps.vars.outputs.sha8 }}" --no-daemon | |
| - name: Upload artifact | |
| if: github.event_name != 'pull_request' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: CommandBridge-dev-${{ steps.vars.outputs.sha8 }} | |
| path: dist/build/libs/CommandBridge-*-all.jar | |
| if-no-files-found: error | |
| retention-days: 60 |