fancy discord uploading v2 #13
Workflow file for this run
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 (multiversion branch) | |
on: [ pull_request, push ] | |
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: 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 }} | |
build_1_19: | |
if: "!startsWith(github.event.head_commit.message, '[skip]')" | |
strategy: | |
matrix: | |
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 | |
path: forge/build/libs/*.jar | |
- name: upload fabric build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cu-artifacts-fabric | |
path: fabric/build/libs/*.jar | |
- name: upload merged build artifact to github | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cu-artifacts-merged | |
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 | |
with: | |
args: 'Build failed for 1.20.1!' | |
build_1_20: | |
if: "!startsWith(github.event.head_commit.message, '[skip]')" | |
strategy: | |
matrix: | |
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.20.1" | |
- name: upload forge build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cu-artifacts-forge | |
path: forge/build/libs/*.jar | |
- name: upload fabric build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cu-artifacts-fabric | |
path: fabric/build/libs/*.jar | |
- name: upload merged build artifact to github | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cu-artifacts-merged | |
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 | |
with: | |
args: 'Build failed for 1.20.1!' |