Update build.yml #20
This file contains 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 Graphite | |
on: | |
push: | |
workflow_dispatch: | |
env: | |
version: 1.20.1 | |
branch: ver/1.20.1 | |
jobs: | |
release: | |
if: "!startsWith(github.event.commits[0].message, '[CI-SKIP]')" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: gradle/wrapper-validation-action@v1 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Configure Git | |
run: git config --global user.email "[email protected]" && git config --global user.name "Github Actions" | |
- name: Apply patches | |
run: ./gradlew applyPatches --stacktrace | |
- name: Build | |
run: ./gradlew build --stacktrace | |
- name: Create Reobf Jar | |
run: ./gradlew createReobfPaperclipJar --stacktrace | |
- name: Create Mojang Jar | |
run: ./gradlew createMojangPaperclipJar --stacktrace | |
- name: Upload Artifacts | |
if: 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 |