Skip to content

refactor: item tools #1355

refactor: item tools

refactor: item tools #1355

Workflow file for this run

name: Allay
on:
push:
branches: [ "master" ]
paths:
- .github/workflows/gradle.yml
- gradle/libs.versions.toml
- api/**
- server/**
- data/**
pull_request:
paths:
- .github/workflows/gradle.yml
- gradle/libs.versions.toml
- api/**
- server/**
- data/**
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Setup WARP
uses: fscarmen/warp-on-actions@v1.3
if: contains(github.ref_name, 'master')
with:
stack: dual
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'zulu'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: wrapper
cache-overwrite-existing: true
cache-read-only: false
build-scan-publish: true
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
build-scan-terms-of-use-agree: "yes"
- name: Build
run: |
chmod +x gradlew
./gradlew build
- name: Generate Coverage Reports
if: success()
run: ./gradlew jacocoTestReport
- name: Upload Coverage Reports to Codecov
uses: codecov/codecov-action@v5.1.1
if: success()
with:
directory: .jacoco/test/
token: ${{ secrets.CODECOV_TOKEN }}
- name: Find Shaded Jar
id: vars
run: |
SHADED_JAR=$(find server/build/libs -name "allay-server-*-shaded.jar" -print -quit)
echo "shaded_jar=$SHADED_JAR" >> $GITHUB_OUTPUT
- name: Upload Artifact
uses: actions/upload-artifact@v4
if: success()
with:
name: allay-server
path: ${{ steps.vars.outputs.shaded_jar }}
- name: Publish to JitPack
if: success() && github.event_name == 'push' && github.repository == 'AllayMC/Allay' && contains(github.ref_name, 'master')
run: |
chmod +x publish_to_jitpack
./publish_to_jitpack
- name: Set Tag
if: success() && github.event_name == 'push' && github.repository == 'AllayMC/Allay' && contains(github.ref_name, 'master')
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git tag -f -a nightly -m "Nightly build"
git push origin -f --follow-tags nightly
- name: Update Nightly Build
uses: WebFreak001/deploy-nightly@v3.2.0
if: success() && github.event_name == 'push' && github.repository == 'AllayMC/Allay' && contains(github.ref_name, 'master')
with:
upload_url: https://uploads.github.com/repos/AllayMC/Allay/releases/185111149/assets{?name,label}
release_id: 185111149
asset_path: ./${{ steps.vars.outputs.shaded_jar }}
asset_name: allay-nightly-build-$$.jar
asset_content_type: application/zip
max_releases: 1
- name: Restart Test Server
uses: fjogeleit/http-request-action@v1
if: success() && github.event_name == 'push' && github.repository == 'AllayMC/Allay' && contains(github.ref_name, 'master')
continue-on-error: true
with:
url: 'http://${{ secrets.TEST_SERVER_HOST }}:${{ secrets.REMOTE_COMMAND_PORT }}/remotecommand?token=${{ secrets.REMOTE_COMMAND_TOKEN }}&command=stop'
method: 'POST'