New textures and layout #57
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 | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- '**.java' | |
- 'src/main/resources/**' | |
pull_request: | |
branches: | |
- main | |
paths: | |
- '**.java' | |
- 'src/main/resources/**' | |
workflow_dispatch: | |
inputs: | |
upload_artifact: | |
description: 'Upload artifact to this run? [yes | no]' | |
required: false | |
default: 'no' | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
env: | |
ORG_GRADLE_PROJECT_buildNumber: ${{ github.run_number }} | |
ORG_GRADLE_PROJECT_runAttempt: ${{ github.run_attempt }} | |
ORG_GRADLE_PROJECT_runningOnCi: ${{ true }} | |
timeout-minutes: 15 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 20 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'gradle' | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build with Gradle | |
run: ./gradlew build --no-daemon | |
- name: Read Project Version | |
id: read_project_version | |
if: ${{ github.ref_name == 'main' || contains(github.event.inputs.upload_artifact, 'yes') }} | |
uses: christian-draeger/read-properties@1.1.1 | |
with: | |
path: gradle.properties | |
properties: version | |
- name: Upload Artifact | |
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' || contains(github.event.inputs.upload_artifact, 'yes') }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Fancy Warp Menu | |
path: build/libs/* | |
- name: Get Pushed Commit Messages | |
if: ${{ github.event_name == 'push' && github.ref_name == 'main' }} | |
run: | | |
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) | |
echo "COMMIT_LOG<<$EOF" >> "$GITHUB_ENV" | |
echo "$(git log -n 20 --format=format:"%aD%n%B" ${{ github.event.before }}..${{ github.event.after }})" >> "$GITHUB_ENV" | |
echo "$EOF" >> "$GITHUB_ENV" | |
- name: Get Head Commit Message | |
if: ${{ env.COMMIT_LOG == '' }} | |
run: | | |
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) | |
echo "COMMIT_LOG<<$EOF" >> "$GITHUB_ENV" | |
echo "$(git show -s --format=format:"%B")" >> "$GITHUB_ENV" | |
echo "$EOF" >> "$GITHUB_ENV" | |
- name: Post Build Information to Discord | |
if: ${{ (github.event_name == 'push' && github.ref_name == 'main') || github.event_name == 'workflow_dispatch' && contains(github.event.inputs.upload_artifact, 'yes') }} | |
env: | |
jarPath: build/libs/FancyWarpMenu-${{ steps.read_project_version.outputs.version }}.${{ github.run_number }}.jar | |
uses: tsickert/discord-webhook@v5.3.0 | |
with: | |
webhook-url: ${{ secrets.BUILD_WEBHOOK_URL }} | |
# New build notifications role | |
content: <@&1124879006597140481> | |
embed-title: ${{ steps.read_project_version.outputs.version }} Build \#${{ github.run_number }} | |
embed-url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/ | |
embed-description: | | |
${{ env.COMMIT_LOG }} | |
[File SHA-256](https://emn178.github.io/online-tools/sha256_checksum.html 'Drop jar onto linked site and verify hash matches the one below.') below ([what's this?](https://github.com/BiscuitDevelopment/SkyblockAddons/wiki/How-to-Verify-the-File-Hash)) | |
embed-footer-text: ${{ hashFiles(env.jarPath) }} | |
filename: ${{ env.jarPath }} |