Fix indentation #83
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 Specific Commit | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| sha: | |
| description: 'The commit SHA to checkout and build' | |
| required: true | |
| publish: | |
| description: 'Whether to publish after building' | |
| required: false | |
| push: | |
| branches: | |
| - master | |
| permissions: | |
| contents: read | |
| statuses: write | |
| jobs: | |
| build_commit: | |
| runs-on: [self-hosted, linux] | |
| steps: | |
| - name: Determine Commit SHA | |
| id: determine_sha | |
| run: | | |
| if [ -z "${{ github.event.inputs.sha }}" ]; then | |
| echo "COMMIT_SHA=${{ github.sha }}" >> $GITHUB_ENV | |
| else | |
| echo "COMMIT_SHA=${{ github.event.inputs.sha }}" >> $GITHUB_ENV | |
| fi | |
| - name: Set Commit Status to Pending | |
| run: | | |
| STATUS="pending" | |
| DESCRIPTION="Build in progress for commit ${{ env.COMMIT_SHA }}" | |
| TARGET_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
| curl -s -X POST \ | |
| -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
| -H "Content-Type: application/json" \ | |
| -d "{ | |
| \"state\": \"$STATUS\", | |
| \"description\": \"$DESCRIPTION\", | |
| \"context\": \"Build Status\", | |
| \"target_url\": \"$TARGET_URL\" | |
| }" \ | |
| "https://api.github.com/repos/${{ github.repository }}/statuses/${{ env.COMMIT_SHA }}" | |
| - name: Checkout the repository at SHA | |
| uses: actions/checkout@v3 | |
| with: | |
| ref: ${{ env.COMMIT_SHA }} | |
| - name: Set up JDK 25 | |
| uses: actions/setup-java@v4.5.0 | |
| with: | |
| java-version: '25' | |
| distribution: 'adopt' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Clear Game Files | |
| run: ./gradlew clearLocalRuntime | |
| - name: Add SteamCMD to PATH | |
| run: echo "/usr/games" >> $GITHUB_PATH | |
| - name: Debug PATH | |
| run: echo $PATH | |
| - name: Clear Game Files | |
| run: ./gradlew prepare | |
| - name: Setup Decompiled Workspace | |
| run: ./gradlew setupDecompWorkspace | |
| - name: Build With Gradle | |
| run: ./gradlew build | |
| - name: Publish Build | |
| if: ${{ github.event.inputs.publish == 'true' }} | |
| run: | | |
| echo "Publishing build..." | |
| ./gradlew publish -PmavenRepoUrl=${{ secrets.MAVEN_REPO }} | |
| - name: Post Build Status | |
| if: always() | |
| run: | | |
| STATUS="success" | |
| DESCRIPTION="Build successful" | |
| if [ ${{ job.status }} != "success" ]; then | |
| STATUS="failure" | |
| DESCRIPTION="Build failed" | |
| fi | |
| TARGET_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
| curl -s -X POST \ | |
| -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
| -H "Content-Type: application/json" \ | |
| -d "{ | |
| \"state\": \"$STATUS\", | |
| \"description\": \"$DESCRIPTION\", | |
| \"context\": \"Build Status\", | |
| \"target_url\": \"$TARGET_URL\" | |
| }" \ | |
| "https://api.github.com/repos/${{ github.repository }}/statuses/${{ env.COMMIT_SHA }}" |