diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..a29519709 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,50 @@ +name: Build + +on: + push: + branches: + - '**' + +jobs: + build: + name: Build DolphinClient + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: '21' + + - name: Set up Gradle + uses: gradle/actions/setup-gradle@v4 + + - name: Build + run: ./gradlew build --stacktrace + + - name: Read mod version + id: version + run: echo "version=$(grep -E '^version=' gradle.properties | cut -d= -f2)" >> "$GITHUB_OUTPUT" + + - name: Upload jars + uses: actions/upload-artifact@v4 + with: + name: DolphinClient-${{ steps.version.outputs.version }}-${{ github.sha }} + path: | + versions/*/build/libs/*.jar + !versions/*/build/libs/*-dev.jar + if-no-files-found: error + + - name: Upload test reports on failure + if: failure() + uses: actions/upload-artifact@v4 + with: + name: test-reports-${{ github.sha }} + path: | + **/build/reports/tests/ + **/build/test-results/ + if-no-files-found: ignore