cleanup #48
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@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: | |
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@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.20.1" | |
- name: upload forge build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cu-artifacts-forge-1.20.1 | |
path: forge/build/libs/*.jar | |
- name: upload fabric build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cu-artifacts-fabric-1.20.1 | |
path: fabric/build/libs/*.jar | |
- name: upload merged build artifact to github | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cu-artifacts-merged-1.20.1 | |
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!' |