Skip to content

Commit

Permalink
Update build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
MrFishCakes committed Aug 1, 2023
1 parent 23835ee commit 35cfb19
Showing 1 changed file with 49 additions and 3 deletions.
52 changes: 49 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
name: Build
on: [ push, pull_request ]
name: Build Graphite

on:
push:
workflow_dispatch:
env:
version: 1.20.1
branch: ver/1.20.1

jobs:
build:
release:

if: "!startsWith(github.event.commits[0].message, '[CI-SKIP]')"

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -10,9 +20,45 @@ jobs:
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

0 comments on commit 35cfb19

Please sign in to comment.