Skip to content

update: README.md

update: README.md #127

Workflow file for this run

name: Build and Upload Development Artifact to Discord
on:
push:
branches:
- 1.19.2
jobs:
build:
runs-on: ubuntu-latest
env:
BUILD: ${{ github.run_number }}
SHA: ${{ github.sha }}
WEBHOOK: ${{ secrets.BUILD_DISCORD_WEBHOOK }}
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Rename the built jar
run: mv build/libs/toastclient-2.1.1.jar toastclient-${{ github.run_number }}.jar
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: toastclient-${{ github.run_number }}
path: toastclient-${{ github.run_number }}.jar
- name: Get branch name
uses: nelonoel/branch-name@v1.0.1
id: branch
- name: Send Discord build message
run: |
COMMIT_MESSAGES=$(git log --pretty=format:'- `%h` %s' -5 --reverse)
(curl "$WEBHOOK" -sS -H "Content-Type:application/json" -X POST -d "{\"content\":null,\"embeds\":[{\"title\":\"Build $BUILD\",\"description\":\"**Branch:** $BRANCH_NAME\\n**Changes:**\\n$COMMIT_MESSAGES\",\"url\":\"https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID\",\"color\":1487872,\"fields\":[{\"name\":\"Artifacts:\",\"value\":\"- [toastclient-$BUILD.zip](https://nightly.link/$GITHUB_REPOSITORY/workflows/gradle.yaml/$BRANCH_NAME/toastclient-$BUILD.zip)\"}],\"footer\":{\"text\":\"$GITHUB_REPOSITORY\"},\"thumbnail\":{\"url\":\"https://upload.wikimedia.org/wikipedia/commons/6/6c/Toast-2.jpg\"}}]}")