2023-02-25 02:05:15 +00:00
|
|
|
name: Build
|
|
|
|
|
2023-03-08 02:59:21 +00:00
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
push:
|
2024-03-09 01:24:16 +00:00
|
|
|
branches-ignore:
|
|
|
|
- 'gh-readonly-queue/**'
|
2023-03-08 02:59:21 +00:00
|
|
|
paths-ignore:
|
|
|
|
- '.github/ISSUE_TEMPLATE/*.yml'
|
2024-04-21 02:07:39 +00:00
|
|
|
- '.github/workflows/build-remote.yml'
|
|
|
|
- '.github/workflows/preview.yml'
|
|
|
|
- '.github/workflows/pull-request.yml'
|
2024-03-04 22:37:45 +00:00
|
|
|
- '.idea/copyright/*.xml'
|
2023-03-08 02:59:21 +00:00
|
|
|
- '.gitignore'
|
|
|
|
- 'CONTRIBUTING.md'
|
|
|
|
- 'LICENSE'
|
|
|
|
- 'Jenkinsfile '
|
|
|
|
- 'README.md'
|
|
|
|
- 'licenseheader.txt'
|
2023-02-25 02:05:15 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
2024-04-18 14:29:40 +00:00
|
|
|
env:
|
|
|
|
PROJECT: 'geyser'
|
2023-02-25 02:05:15 +00:00
|
|
|
steps:
|
2024-04-20 01:47:00 +00:00
|
|
|
- name: Set Build Number
|
|
|
|
env:
|
|
|
|
BUILD_JSON: ${{ vars.RELEASEACTION_PREVRELEASE }}
|
|
|
|
run: |
|
|
|
|
BUILD_NUMBER=$(echo $BUILD_JSON | jq --arg branch "${GITHUB_REF_NAME}" 'if .[$branch] == null then 1 else .[$branch] | .t | tonumber + 1 end // 1')
|
2024-04-21 02:07:39 +00:00
|
|
|
echo "BUILD_NUMBER=${BUILD_NUMBER:=$GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
|
2024-04-20 01:47:00 +00:00
|
|
|
|
2023-02-25 02:05:15 +00:00
|
|
|
- name: Checkout repository and submodules
|
2023-09-13 14:46:45 +00:00
|
|
|
# See https://github.com/actions/checkout/commits
|
2024-03-04 22:37:45 +00:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2023-02-25 02:05:15 +00:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
|
2023-03-30 15:02:12 +00:00
|
|
|
- name: Validate Gradle Wrapper
|
2023-09-13 14:46:45 +00:00
|
|
|
# See https://github.com/gradle/wrapper-validation-action/commits
|
2024-03-04 22:37:45 +00:00
|
|
|
uses: gradle/wrapper-validation-action@699bb18358f12c5b78b37bb0111d3a0e2276e0e2 # v2.1.1
|
2023-03-30 15:02:12 +00:00
|
|
|
|
2023-09-13 14:46:45 +00:00
|
|
|
# See https://github.com/actions/setup-java/commits
|
2024-03-04 22:37:45 +00:00
|
|
|
- uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0
|
2023-02-25 02:05:15 +00:00
|
|
|
with:
|
2024-04-23 21:14:54 +00:00
|
|
|
java-version: 21
|
2023-02-25 02:05:15 +00:00
|
|
|
distribution: temurin
|
2023-03-08 02:59:21 +00:00
|
|
|
|
2023-02-25 02:05:15 +00:00
|
|
|
- name: Build
|
2024-04-20 01:47:00 +00:00
|
|
|
# See https://github.com/gradle/actions/commits
|
|
|
|
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
|
2023-02-25 02:05:15 +00:00
|
|
|
with:
|
2023-03-30 15:02:12 +00:00
|
|
|
arguments: build
|
|
|
|
gradle-home-cache-cleanup: true
|
2023-03-08 02:59:21 +00:00
|
|
|
|
|
|
|
- name: Archive artifacts (Geyser Fabric)
|
2023-09-13 14:46:45 +00:00
|
|
|
# See https://github.com/actions/upload-artifact/commits
|
2024-03-04 22:37:45 +00:00
|
|
|
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
|
2023-03-08 02:59:21 +00:00
|
|
|
if: success()
|
|
|
|
with:
|
|
|
|
name: Geyser Fabric
|
2024-02-23 16:58:39 +00:00
|
|
|
path: bootstrap/mod/fabric/build/libs/Geyser-Fabric.jar
|
|
|
|
if-no-files-found: error
|
|
|
|
- name: Archive artifacts (Geyser NeoForge)
|
2024-03-04 22:37:45 +00:00
|
|
|
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
|
2024-02-23 16:58:39 +00:00
|
|
|
if: success()
|
|
|
|
with:
|
|
|
|
name: Geyser NeoForge
|
|
|
|
path: bootstrap/mod/neoforge/build/libs/Geyser-NeoForge.jar
|
2023-03-08 02:59:21 +00:00
|
|
|
if-no-files-found: error
|
|
|
|
- name: Archive artifacts (Geyser Standalone)
|
2024-03-04 22:37:45 +00:00
|
|
|
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
|
2023-03-08 02:59:21 +00: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 22:37:45 +00:00
|
|
|
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
|
2023-03-08 02:59:21 +00: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 22:37:45 +00:00
|
|
|
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
|
2023-03-08 02:59:21 +00: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 22:37:45 +00:00
|
|
|
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
|
2023-03-08 02:59:21 +00:00
|
|
|
if: success()
|
|
|
|
with:
|
|
|
|
name: Geyser Velocity
|
|
|
|
path: bootstrap/velocity/build/libs/Geyser-Velocity.jar
|
|
|
|
if-no-files-found: error
|
2024-02-19 21:25:49 +00:00
|
|
|
- name: Archive artifacts (Geyser ViaProxy)
|
2024-03-04 22:37:45 +00:00
|
|
|
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
|
2024-02-19 21:25:49 +00:00
|
|
|
if: success()
|
|
|
|
with:
|
|
|
|
name: Geyser ViaProxy
|
|
|
|
path: bootstrap/viaproxy/build/libs/Geyser-ViaProxy.jar
|
|
|
|
if-no-files-found: error
|
2023-02-25 02:05:15 +00:00
|
|
|
|
|
|
|
- name: Publish to Maven Repository
|
2023-03-30 15:02:12 +00:00
|
|
|
if: ${{ success() && github.repository == 'GeyserMC/Geyser' && github.ref_name == 'master' }}
|
2024-03-04 22:37:45 +00:00
|
|
|
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5
|
2023-02-25 02:05:15 +00:00
|
|
|
env:
|
|
|
|
ORG_GRADLE_PROJECT_geysermcUsername: ${{ vars.DEPLOY_USER }}
|
|
|
|
ORG_GRADLE_PROJECT_geysermcPassword: ${{ secrets.DEPLOY_PASS }}
|
|
|
|
with:
|
|
|
|
arguments: publish
|
|
|
|
|
2024-04-18 14:29:40 +00:00
|
|
|
- name: Get Release Metadata
|
|
|
|
if: ${{ success() && github.repository == 'GeyserMC/Geyser' && github.ref_name == 'master' }}
|
2024-04-20 01:47:00 +00:00
|
|
|
# See https://github.com/Kas-tle/base-release-action/releases/tag/main-11
|
|
|
|
uses: Kas-tle/base-release-action@b863fa0f89bd15267a96a72efb84aec25f168d4c # main-11
|
2024-04-18 14:29:40 +00:00
|
|
|
with:
|
|
|
|
appID: ${{ secrets.RELEASE_APP_ID }}
|
|
|
|
appPrivateKey: ${{ secrets.RELEASE_APP_PK }}
|
|
|
|
files: |
|
|
|
|
bungeecord:bootstrap/bungeecord/build/libs/Geyser-BungeeCord.jar
|
|
|
|
fabric:bootstrap/mod/fabric/build/libs/Geyser-Fabric.jar
|
|
|
|
neoforge:bootstrap/mod/neoforge/build/libs/Geyser-NeoForge.jar
|
|
|
|
spigot:bootstrap/spigot/build/libs/Geyser-Spigot.jar
|
|
|
|
standalone:bootstrap/standalone/build/libs/Geyser-Standalone.jar
|
|
|
|
velocity:bootstrap/velocity/build/libs/Geyser-Velocity.jar
|
|
|
|
viaproxy:bootstrap/viaproxy/build/libs/Geyser-ViaProxy.jar
|
|
|
|
releaseEnabled: false
|
|
|
|
saveMetadata: true
|
|
|
|
- name: Update Generated Metadata
|
|
|
|
if: ${{ success() && github.repository == 'GeyserMC/Geyser' && github.ref_name == 'master' }}
|
|
|
|
run: |
|
|
|
|
cat metadata.json
|
|
|
|
echo
|
2024-04-28 14:43:33 +00:00
|
|
|
mv metadata.json metadata.json.tmp
|
2024-04-18 14:29:40 +00:00
|
|
|
version=$(cat gradle.properties | grep -o "version=[0-9\\.]*" | cut -d"=" -f2)
|
2024-04-28 14:43:33 +00:00
|
|
|
jq --arg project "${PROJECT}" --arg version "${version}" '
|
2024-04-18 14:29:40 +00:00
|
|
|
.
|
|
|
|
| .changes |= map({"commit", "summary", "message"})
|
|
|
|
| .downloads |= map_values({"name", "sha256"})
|
|
|
|
| {$project, "repo", $version, "number": .build, "changes", "downloads"}
|
2024-04-28 14:43:33 +00:00
|
|
|
' metadata.json.tmp > metadata.json
|
|
|
|
cat metadata.json
|
2023-02-25 02:05:15 +00:00
|
|
|
- name: Publish to Downloads API
|
2023-03-30 15:02:12 +00:00
|
|
|
if: ${{ success() && github.repository == 'GeyserMC/Geyser' && github.ref_name == 'master' }}
|
2023-02-25 02:05:15 +00:00
|
|
|
shell: bash
|
2023-02-25 02:57:43 +00:00
|
|
|
env:
|
2023-02-25 03:08:02 +00:00
|
|
|
DOWNLOADS_USERNAME: ${{ vars.DOWNLOADS_USERNAME }}
|
2023-02-25 02:57:43 +00:00
|
|
|
DOWNLOADS_PRIVATE_KEY: ${{ secrets.DOWNLOADS_PRIVATE_KEY }}
|
|
|
|
DOWNLOADS_SERVER_IP: ${{ secrets.DOWNLOADS_SERVER_IP }}
|
2023-02-25 02:05:15 +00:00
|
|
|
run: |
|
|
|
|
# Save the private key to a file
|
|
|
|
echo "$DOWNLOADS_PRIVATE_KEY" > id_ecdsa
|
|
|
|
chmod 600 id_ecdsa
|
2023-03-19 17:09:18 +00:00
|
|
|
# Create the build folder
|
2024-04-18 14:29:40 +00:00
|
|
|
ssh -o StrictHostKeyChecking=no -i id_ecdsa $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP mkdir -p "~/uploads/$PROJECT/$GITHUB_RUN_NUMBER/"
|
2023-02-25 02:05:15 +00:00
|
|
|
# Copy over artifacts
|
2024-04-18 14:29:40 +00: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/
|
|
|
|
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 02:05:15 +00:00
|
|
|
# Run the build script
|
2024-04-18 14:29:40 +00:00
|
|
|
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 02:05:15 +00:00
|
|
|
|
2024-02-23 16:58:39 +00:00
|
|
|
- name: Publish to Modrinth (Fabric)
|
2024-03-04 22:37:45 +00:00
|
|
|
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5
|
2023-03-30 15:02:12 +00: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 16:58:39 +00:00
|
|
|
|
|
|
|
- name: Publish to Modrinth (NeoForge)
|
2024-03-04 22:37:45 +00:00
|
|
|
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5
|
2024-02-23 16:58:39 +00: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 02:05:15 +00:00
|
|
|
- name: Notify Discord
|
2023-02-25 02:36:51 +00:00
|
|
|
if: ${{ (success() || failure()) && github.repository == 'GeyserMC/Geyser' }}
|
2023-09-13 14:46:45 +00:00
|
|
|
# See https://github.com/Tim203/actions-git-discord-webhook/commits
|
|
|
|
uses: Tim203/actions-git-discord-webhook@70f38ded3aca51635ec978ab4e1a58cd4cd0c2ff
|
2023-02-25 02:05:15 +00:00
|
|
|
with:
|
|
|
|
webhook_url: ${{ secrets.DISCORD_WEBHOOK }}
|
2024-04-20 01:47:00 +00:00
|
|
|
status: ${{ job.status }}
|