name: Build DivineMC on: push: workflow_dispatch: env: version: 1.19.2 branch: ver/1.19.2 debug: 'false' jobs: build: runs-on: ubuntu-latest if: "!contains(github.event.commits[0].message, '[ci-skip]')" steps: - uses: actions/checkout@v2 - uses: gradle/wrapper-validation-action@v1 - name: Setup JDK 17 uses: actions/setup-java@v2 with: distribution: temurin java-version: 17 cache: 'gradle' - name: Configure Git run: | git config --global user.email "no-reply@github.com" && git config --global user.name "Github Actions" echo "workflow=$GITHUB_RUN_NUMBER" >> $GITHUB_ENV chmod +x gradlew - name: Patch run: ./gradlew applyPatches --stacktrace - name: Create Reobf Jar run: ./gradlew createReobfPaperclipJar --stacktrace - name: Create Mojmap Jar run: ./gradlew createMojmapPaperclipJar --stacktrace - name: Upload Artifacts if: env.debug == 'true' || github.ref_name != env.branch uses: actions/upload-artifact@main with: name: Artifacts path: build/libs - name: Release Artifacts if: github.ref_name == env.branch uses: marvinpinto/action-automatic-releases@latest with: title: "Release #${{ env.workflow }}" automatic_release_tag: release-${{ env.workflow }} repo_token: "${{ secrets.GITHUB_TOKEN }}" files: build/libs/*.jar prerelease: false - name: Release Artifacts (Latest) if: github.ref_name == env.branch uses: marvinpinto/action-automatic-releases@latest with: title: "Release #${{ env.workflow }}" automatic_release_tag: latest-${{ env.version }} repo_token: "${{ secrets.GITHUB_TOKEN }}" files: build/libs/*.jar prerelease: false