Skip to content

Commit

Permalink
update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysdh540 committed Oct 11, 2023
1 parent e0a8ff1 commit 56cf270
Showing 1 changed file with 93 additions and 89 deletions.
182 changes: 93 additions & 89 deletions .github/workflows/build-multiver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ jobs:
webhook-message:
runs-on: ubuntu-latest
steps:
- name: Get branch name
id: get_branch
run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
- name: Get branch name
id: get_branch
run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT

- name: send building message to discord
if: "!startsWith(github.event.head_commit.message, '[skip]')"
uses: realRobotix/action-discord-notifier@release-master
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
message-title: Building mod from branch ${{ steps.get_branch.outputs.branch }}
- name: send building message to discord
if: "!startsWith(github.event.head_commit.message, '[skip]')"
uses: realRobotix/action-discord-notifier@release-master
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
message-title: Building mod from branch ${{ steps.get_branch.outputs.branch }}

- name: send not building message to discord
if: "startsWith(github.event.head_commit.message, '[skip]')"
uses: realRobotix/action-discord-notifier@release-master
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
message-title: Build skipped for branch ${{ steps.get_branch.outputs.branch }}
- name: send not building message to discord
if: "startsWith(github.event.head_commit.message, '[skip]')"
uses: realRobotix/action-discord-notifier@release-master
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
message-title: Build skipped for branch ${{ steps.get_branch.outputs.branch }}


build_1_19:
Expand All @@ -31,64 +31,66 @@ jobs:
java: [ 17 ]
runs-on: ubuntu-latest
steps:
- name: steal code from repository
uses: actions/checkout@v3

- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}

- name: cache gradle
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/loom-cache
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle

- name: give gradle permission to murder github servers
run: chmod +x ./gradlew

- name: gradle murders github servers
run: ./gradlew assemble -PmcVer="1.19.2"

- name: upload forge build artifacts
uses: actions/upload-artifact@v3
with:
name: cu-artifacts-forge-1.19.2
path: forge/build/libs/*.jar

- name: upload fabric build artifacts
uses: actions/upload-artifact@v3
with:
name: cu-artifacts-fabric-1.19.2
path: fabric/build/libs/*.jar

- name: upload merged build artifact to github
uses: actions/upload-artifact@v3
with:
name: cu-artifacts-merged-1.19.2
path: |
build/libs/merged/*.jar
- name: upload merged build artifact to discord
if: success()
uses: sinshutu/upload-to-discord@master
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
with:
args: build/libs/merged/*.jar

- name: send build failure message to discord
if: failure()
uses: ilshidur/action-discord@master
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
with:
args: 'Build failed for 1.19.2!'
- name: steal code from repository
uses: actions/checkout@v3

- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: zulu
cache: gradle

- name: cache gradle
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/loom-cache
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle

- name: give gradle permission to murder github servers
run: chmod +x ./gradlew

- name: gradle murders github servers
run: ./gradlew assemble -PmcVer="1.19.2"

- name: upload forge build artifacts
uses: actions/upload-artifact@v3
with:
name: cu-artifacts-forge-1.19.2
path: forge/build/libs/*.jar

- name: upload fabric build artifacts
uses: actions/upload-artifact@v3
with:
name: cu-artifacts-fabric-1.19.2
path: fabric/build/libs/*.jar

- name: upload merged build artifact to github
uses: actions/upload-artifact@v3
with:
name: cu-artifacts-merged-1.19.2
path: |
build/libs/merged/*.jar
- name: upload merged build artifact to discord
if: success()
uses: sinshutu/upload-to-discord@master
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
with:
args: build/libs/merged/*.jar

- name: send build failure message to discord
if: failure()
uses: ilshidur/action-discord@master
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
with:
args: 'Build failed for 1.19.2!'


build_1_20:
Expand All @@ -103,9 +105,11 @@ jobs:
uses: actions/checkout@v3

- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: zulu
cache: gradle

- name: cache gradle
uses: actions/cache@v3
Expand Down Expand Up @@ -142,18 +146,18 @@ jobs:
path: |
build/libs/merged/*.jar
- name: upload merged build artifact to discord
if: success()
uses: sinshutu/upload-to-discord@master
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
with:
args: build/libs/merged/*.jar

- name: send build failure message to discord
if: failure()
uses: ilshidur/action-discord@master
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
with:
args: 'Build failed for 1.20.1!'
- name: upload merged build artifact to discord
if: success()
uses: sinshutu/upload-to-discord@master
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
with:
args: build/libs/merged/*.jar

- name: send build failure message to discord
if: failure()
uses: ilshidur/action-discord@master
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
with:
args: 'Build failed for 1.20.1!'

0 comments on commit 56cf270

Please sign in to comment.