1+ name : Build
2+
3+ on :
4+ workflow_dispatch :
5+ push :
6+ paths-ignore :
7+ - ' .idea/copyright/*.xml'
8+ - ' .gitignore'
9+ - ' LICENSE'
10+ - ' README.md'
11+
12+ jobs :
13+ build :
14+ runs-on : ubuntu-latest
15+
16+ steps :
17+ - name : Setup Gradle
18+ uses : GeyserMC/actions/setup-gradle-composite@master
19+ with :
20+ setup-java_java-version : 17
21+
22+ - name : Build EmoteOffhandExtension
23+ run : ./gradlew build
24+
25+ - name : Archive Artifacts
26+ uses : GeyserMC/actions/upload-multi-artifact@master
27+ if : success()
28+ with :
29+ artifacts : build/libs/EmoteOffhand.jar
30+
31+ - name : Get Version
32+ if : ${{ success() && github.repository == 'GeyserMC/EmoteOffhandExtension' && github.ref_name == 'master' }}
33+ id : get-version
34+ run : |
35+ version=$(cat build.gradle | grep -o "version '[0-9\\.]*'" | cut -d" " -f2 | sed "s/'//g")
36+ echo "VERSION=${version}" >> $GITHUB_OUTPUT
37+
38+ - name : Get Release Metadata
39+ if : ${{ success() && github.repository == 'GeyserMC/EmoteOffhandExtension' && github.ref_name == 'master' }}
40+ uses : GeyserMC/actions/release@master
41+ id : metadata
42+ with :
43+ appID : ${{ secrets.RELEASE_APP_ID }}
44+ appPrivateKey : ${{ secrets.RELEASE_APP_PK }}
45+ files : |
46+ emoteoffhand:build/libs/EmoteOffhand.jar
47+ releaseEnabled : false
48+ saveMetadata : true
49+ releaseProject : ' emoteoffhand'
50+ releaseVersion : ${{ steps.get-version.outputs.VERSION }}
51+
52+ - name : Publish to Downloads API
53+ if : ${{ success() && github.repository == 'GeyserMC/EmoteOffhandExtension' && github.ref_name == 'master' }}
54+ uses : GeyserMC/actions/upload-release@master
55+ with :
56+ username : ${{ vars.DOWNLOADS_USERNAME }}
57+ privateKey : ${{ secrets.DOWNLOADS_PRIVATE_KEY }}
58+ host : ${{ secrets.DOWNLOADS_SERVER_IP }}
59+ files : |
60+ build/libs/EmoteOffhand.jar
61+ changelog : ${{ steps.metadata.outputs.body }}
62+
63+ - name : Notify Discord
64+ if : ${{ (success() || failure()) && github.repository == 'GeyserMC/EmoteOffhandExtension' }}
65+ uses : GeyserMC/actions/notify-discord@master
66+ with :
67+ discordWebhook : ${{ secrets.DISCORD_WEBHOOK }}
68+ status : ${{ job.status }}
69+ body : ${{ steps.metadata.outputs.body }}
0 commit comments