PacketLogger Revamp #1242
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: gradle.build | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
BUILD: ${{ github.run_number }} | |
SHA: ${{ github.sha }} | |
WEBHOOK: ${{ secrets.BUILD_DISCORD_WEBHOOK }} | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3.5.2 | |
- name: Set up JDK | |
uses: actions/setup-java@v3.11.0 | |
with: | |
distribution: 'temurin' | |
java-version: 8 | |
- name: Elevate wrapper permissions | |
run: chmod +x ./gradlew | |
- name: Loading gradle cache | |
uses: actions/cache@v3.3.1 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Prepare workspace | |
run: ./gradlew --no-daemon classes | |
- name: Build lambda utility mod | |
run: ./gradlew --build-cache build | |
- name: Rename built forge mod | |
run: mv build/libs/lambda-*.jar lambda-${{ github.run_number }}.jar | |
- name: Generate forge mod checksum | |
uses: ToxicAven/generate-checksum-file@v2 | |
with: | |
filePath: lambda-${{ github.run_number }}.jar | |
saveFile: lambda-${{ github.run_number }}-SHA256.txt | |
algorithm: SHA256 | |
- name: Archive forge mod | |
uses: actions/upload-artifact@v3.1.2 | |
with: | |
name: lambda-${{ github.run_number }} | |
path: lambda-${{ github.run_number }}.jar | |
- name: Archive forge mod checksum | |
uses: actions/upload-artifact@v3.1.2 | |
with: | |
name: lambda-${{ github.run_number }}-SHA256.txt | |
path: lambda-${{ github.run_number }}-SHA256.txt | |
- name: Build plugin API | |
run: ./gradlew --no-build-cache buildApi | |
- name: Rename built plugin API | |
run: mv build/libs/lambda-*-api.jar lambda-${{ github.run_number }}-api.jar | |
- name: Generate API mod checksum | |
uses: ToxicAven/generate-checksum-file@v2 | |
with: | |
filePath: lambda-${{ github.run_number }}-api.jar | |
saveFile: lambda-${{ github.run_number }}-api-SHA256.txt | |
algorithm: SHA256 | |
- name: Archive plugin API | |
uses: actions/upload-artifact@v3.1.2 | |
with: | |
name: lambda-${{ github.run_number }}-api | |
path: lambda-${{ github.run_number }}-api.jar | |
- name: Upload API checksum | |
uses: actions/upload-artifact@v3.1.2 | |
with: | |
name: lambda-${{ github.run_number }}-api-SHA256.txt | |
path: lambda-${{ github.run_number }}-api-SHA256.txt | |
- name: Get branch name | |
id: branch-name | |
uses: tj-actions/branch-names@v7 | |
- name: Send Discord build message | |
if: steps.branch-name.outputs.is_default == 'true' | |
run: | | |
COMMITMESSAGE=`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:** ${{steps.branch-name.outputs.current_branch}}\\n**Changes:**\\n$COMMITMESSAGE\",\"url\":\"https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID\",\"color\":1487872,\"fields\":[{\"name\":\"Artifacts:\",\"value\":\"- [lambda-$BUILD.zip](https://nightly.link/$GITHUB_REPOSITORY/workflows/nightly_build.yml/$BRANCH_NAME/lambda-$BUILD.zip)\"}],\"footer\":{\"text\":\"$GITHUB_REPOSITORY\"},\"thumbnail\":{\"url\":\"https://raw.githubusercontent.com/lambda-client/lambda/master/src/main/resources/assets/minecraft/lambda/lambda_map.png\"}}],\"username\":\"Github Actions\",\"avatar_url\":\"https://www.2b2t.com.au/assets/github.jpeg\"}") |