2023-02-25 03:05:15 +01:00
|
|
|
name: Build
|
|
|
|
|
2023-03-08 03:59:21 +01:00
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
push:
|
2024-03-09 02:24:16 +01:00
|
|
|
branches-ignore:
|
|
|
|
- 'gh-readonly-queue/**'
|
2023-03-08 03:59:21 +01:00
|
|
|
paths-ignore:
|
|
|
|
- '.github/ISSUE_TEMPLATE/*.yml'
|
|
|
|
- '.github/actions/pullrequest.yml'
|
2024-03-04 23:37:45 +01:00
|
|
|
- '.idea/copyright/*.xml'
|
2023-03-08 03:59:21 +01:00
|
|
|
- '.gitignore'
|
|
|
|
- 'CONTRIBUTING.md'
|
|
|
|
- 'LICENSE'
|
|
|
|
- 'Jenkinsfile '
|
|
|
|
- 'README.md'
|
|
|
|
- 'licenseheader.txt'
|
2023-02-25 03:05:15 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository and submodules
|
2023-09-13 16:46:45 +02:00
|
|
|
# See https://github.com/actions/checkout/commits
|
2024-03-04 23:37:45 +01:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2023-02-25 03:05:15 +01:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
|
2023-03-30 17:02:12 +02:00
|
|
|
- name: Validate Gradle Wrapper
|
2023-09-13 16:46:45 +02:00
|
|
|
# See https://github.com/gradle/wrapper-validation-action/commits
|
2024-03-04 23:37:45 +01:00
|
|
|
uses: gradle/wrapper-validation-action@699bb18358f12c5b78b37bb0111d3a0e2276e0e2 # v2.1.1
|
2023-03-30 17:02:12 +02:00
|
|
|
|
2023-09-13 16:46:45 +02:00
|
|
|
# See https://github.com/actions/setup-java/commits
|
2024-03-04 23:37:45 +01:00
|
|
|
- uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0
|
2023-02-25 03:05:15 +01:00
|
|
|
with:
|
|
|
|
java-version: 17
|
|
|
|
distribution: temurin
|
2023-03-08 03:59:21 +01:00
|
|
|
|
2023-02-25 03:05:15 +01:00
|
|
|
- name: Build
|
2023-09-13 16:46:45 +02:00
|
|
|
# See https://github.com/gradle/gradle-build-action/commits
|
2024-03-04 23:37:45 +01:00
|
|
|
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 from https://github.com/gradle/actions/commits
|
2023-02-25 03:05:15 +01:00
|
|
|
with:
|
2023-03-30 17:02:12 +02:00
|
|
|
arguments: build
|
|
|
|
gradle-home-cache-cleanup: true
|
2023-03-08 03:59:21 +01:00
|
|
|
|
|
|
|
- name: Archive artifacts (Geyser Fabric)
|
2023-09-13 16:46:45 +02:00
|
|
|
# See https://github.com/actions/upload-artifact/commits
|
2024-03-04 23:37:45 +01:00
|
|
|
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
|
2023-03-08 03:59:21 +01:00
|
|
|
if: success()
|
|
|
|
with:
|
|
|
|
name: Geyser Fabric
|
2024-02-23 17:58:39 +01:00
|
|
|
path: bootstrap/mod/fabric/build/libs/Geyser-Fabric.jar
|
|
|
|
if-no-files-found: error
|
|
|
|
- name: Archive artifacts (Geyser NeoForge)
|
2024-03-04 23:37:45 +01:00
|
|
|
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
|
2024-02-23 17:58:39 +01:00
|
|
|
if: success()
|
|
|
|
with:
|
|
|
|
name: Geyser NeoForge
|
|
|
|
path: bootstrap/mod/neoforge/build/libs/Geyser-NeoForge.jar
|
2023-03-08 03:59:21 +01:00
|
|
|
if-no-files-found: error
|
|
|
|
- name: Archive artifacts (Geyser Standalone)
|
2024-03-04 23:37:45 +01:00
|
|
|
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
|
2023-03-08 03:59:21 +01:00
|
|
|
if: success()
|
|
|
|
with:
|
|
|
|
name: Geyser Standalone
|
|
|
|
path: bootstrap/standalone/build/libs/Geyser-Standalone.jar
|
|
|
|
if-no-files-found: error
|
|
|
|
- name: Archive artifacts (Geyser Spigot)
|
2024-03-04 23:37:45 +01:00
|
|
|
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
|
2023-03-08 03:59:21 +01:00
|
|
|
if: success()
|
|
|
|
with:
|
|
|
|
name: Geyser Spigot
|
|
|
|
path: bootstrap/spigot/build/libs/Geyser-Spigot.jar
|
|
|
|
if-no-files-found: error
|
|
|
|
- name: Archive artifacts (Geyser BungeeCord)
|
2024-03-04 23:37:45 +01:00
|
|
|
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
|
2023-03-08 03:59:21 +01:00
|
|
|
if: success()
|
|
|
|
with:
|
|
|
|
name: Geyser BungeeCord
|
|
|
|
path: bootstrap/bungeecord/build/libs/Geyser-BungeeCord.jar
|
|
|
|
if-no-files-found: error
|
|
|
|
- name: Archive artifacts (Geyser Velocity)
|
2024-03-04 23:37:45 +01:00
|
|
|
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
|
2023-03-08 03:59:21 +01:00
|
|
|
if: success()
|
|
|
|
with:
|
|
|
|
name: Geyser Velocity
|
|
|
|
path: bootstrap/velocity/build/libs/Geyser-Velocity.jar
|
|
|
|
if-no-files-found: error
|
2024-02-19 22:25:49 +01:00
|
|
|
- name: Archive artifacts (Geyser ViaProxy)
|
2024-03-04 23:37:45 +01:00
|
|
|
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
|
2024-02-19 22:25:49 +01:00
|
|
|
if: success()
|
|
|
|
with:
|
|
|
|
name: Geyser ViaProxy
|
|
|
|
path: bootstrap/viaproxy/build/libs/Geyser-ViaProxy.jar
|
|
|
|
if-no-files-found: error
|
2023-02-25 03:05:15 +01:00
|
|
|
|
|
|
|
- name: Publish to Maven Repository
|
2023-03-30 17:02:12 +02:00
|
|
|
if: ${{ success() && github.repository == 'GeyserMC/Geyser' && github.ref_name == 'master' }}
|
2024-03-04 23:37:45 +01:00
|
|
|
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5
|
2023-02-25 03:05:15 +01:00
|
|
|
env:
|
|
|
|
ORG_GRADLE_PROJECT_geysermcUsername: ${{ vars.DEPLOY_USER }}
|
|
|
|
ORG_GRADLE_PROJECT_geysermcPassword: ${{ secrets.DEPLOY_PASS }}
|
|
|
|
with:
|
|
|
|
arguments: publish
|
|
|
|
|
|
|
|
- name: Publish to Downloads API
|
2023-03-30 17:02:12 +02:00
|
|
|
if: ${{ success() && github.repository == 'GeyserMC/Geyser' && github.ref_name == 'master' }}
|
2023-02-25 03:05:15 +01:00
|
|
|
shell: bash
|
2023-02-25 03:57:43 +01:00
|
|
|
env:
|
2023-02-25 04:08:02 +01:00
|
|
|
DOWNLOADS_USERNAME: ${{ vars.DOWNLOADS_USERNAME }}
|
2023-02-25 03:57:43 +01:00
|
|
|
DOWNLOADS_PRIVATE_KEY: ${{ secrets.DOWNLOADS_PRIVATE_KEY }}
|
|
|
|
DOWNLOADS_SERVER_IP: ${{ secrets.DOWNLOADS_SERVER_IP }}
|
2023-02-25 03:05:15 +01:00
|
|
|
run: |
|
|
|
|
# Save the private key to a file
|
|
|
|
echo "$DOWNLOADS_PRIVATE_KEY" > id_ecdsa
|
|
|
|
chmod 600 id_ecdsa
|
2023-03-19 16:08:51 +01:00
|
|
|
# Set the project
|
|
|
|
project=geyser
|
2023-02-25 03:05:15 +01:00
|
|
|
# Get the version from gradle.properties
|
|
|
|
version=$(cat gradle.properties | grep -o "version=[0-9\\.]*" | cut -d"=" -f2)
|
2023-03-19 18:09:18 +01:00
|
|
|
# Create the build folder
|
|
|
|
ssh -o StrictHostKeyChecking=no -i id_ecdsa $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP mkdir -p "~/uploads/$project/$GITHUB_RUN_NUMBER/"
|
2023-02-25 03:05:15 +01:00
|
|
|
# Copy over artifacts
|
2023-03-19 16:08:51 +01:00
|
|
|
rsync -P -e "ssh -o StrictHostKeyChecking=no -i id_ecdsa" bootstrap/**/build/libs/Geyser-*.jar $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP:~/uploads/$project/$GITHUB_RUN_NUMBER/
|
2024-02-23 18:40:41 +01:00
|
|
|
rsync -P -e "ssh -o StrictHostKeyChecking=no -i id_ecdsa" bootstrap/mod/**/build/libs/Geyser-*.jar $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP:~/uploads/$project/$GITHUB_RUN_NUMBER/
|
2023-02-25 03:05:15 +01:00
|
|
|
# Run the build script
|
2023-03-19 16:08:51 +01:00
|
|
|
# Push the metadata
|
|
|
|
echo "{\"project\": \"$project\", \"version\": \"$version\", \"id\": $GITHUB_RUN_NUMBER, \"commit\": \"$GITHUB_SHA\"}" > metadata.json
|
|
|
|
rsync -P -e "ssh -o StrictHostKeyChecking=no -i id_ecdsa" metadata.json $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP:~/uploads/$project/$GITHUB_RUN_NUMBER/
|
2023-02-25 03:05:15 +01:00
|
|
|
|
2024-02-23 17:58:39 +01:00
|
|
|
- name: Publish to Modrinth (Fabric)
|
2024-03-04 23:37:45 +01:00
|
|
|
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5
|
2023-03-30 17:02:12 +02:00
|
|
|
if: ${{ success() && github.repository == 'GeyserMC/Geyser' && github.ref_name == 'master' }}
|
|
|
|
env:
|
|
|
|
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
|
|
|
|
with:
|
|
|
|
arguments: fabric:modrinth
|
|
|
|
gradle-home-cache-cleanup: true
|
2024-02-23 17:58:39 +01:00
|
|
|
|
|
|
|
- name: Publish to Modrinth (NeoForge)
|
2024-03-04 23:37:45 +01:00
|
|
|
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5
|
2024-02-23 17:58:39 +01:00
|
|
|
if: ${{ success() && github.repository == 'GeyserMC/Geyser' && github.ref_name == 'master' }}
|
|
|
|
env:
|
|
|
|
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
|
|
|
|
with:
|
|
|
|
arguments: neoforge:modrinth
|
|
|
|
gradle-home-cache-cleanup: true
|
|
|
|
|
2023-02-25 03:05:15 +01:00
|
|
|
- name: Notify Discord
|
2023-02-25 03:36:51 +01:00
|
|
|
if: ${{ (success() || failure()) && github.repository == 'GeyserMC/Geyser' }}
|
2023-09-13 16:46:45 +02:00
|
|
|
# See https://github.com/Tim203/actions-git-discord-webhook/commits
|
|
|
|
uses: Tim203/actions-git-discord-webhook@70f38ded3aca51635ec978ab4e1a58cd4cd0c2ff
|
2023-02-25 03:05:15 +01:00
|
|
|
with:
|
|
|
|
webhook_url: ${{ secrets.DISCORD_WEBHOOK }}
|
2023-02-25 03:36:51 +01:00
|
|
|
status: ${{ job.status }}
|