3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-12-24 15:20:25 +01:00

Switch to centralized GitHub actions (#4693)

* Switch to centralized GitHub actions

* Update PR actions as well

* Publish preview only if success

* Webhook on success & failure
Dieser Commit ist enthalten in:
Kas-tle 2024-05-27 10:59:36 -07:00 committet von GitHub
Ursprung 3570caae25
Commit cf27b88cc8
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194
3 geänderte Dateien mit 97 neuen und 121 gelöschten Zeilen

Datei anzeigen

@ -22,79 +22,79 @@ jobs:
run: | run: |
echo "BUILD_NUMBER=${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV echo "BUILD_NUMBER=${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
- name: Set up JDK 21 - name: Setup Java
# See https://github.com/actions/setup-java/commits # See https://github.com/actions/setup-java/commits
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0 uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with: with:
java-version: 21 java-version: 21
distribution: temurin distribution: temurin
- name: Checkout repository and submodules - name: Checkout repository and submodules
# See https://github.com/actions/checkout/commits # See https://github.com/actions/checkout/commits
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with: with:
repository: ${{ inputs.repository }} repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }} ref: ${{ inputs.ref }}
submodules: recursive submodules: recursive
path: geyser
- name: Validate Gradle Wrapper - name: Validate Gradle Wrapper
# See https://github.com/gradle/wrapper-validation-action/commits # See https://github.com/gradle/wrapper-validation-action/commits
uses: gradle/wrapper-validation-action@699bb18358f12c5b78b37bb0111d3a0e2276e0e2 # v2.1.1 uses: gradle/actions/wrapper-validation@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2
- name: Setup Gradle
# See https://github.com/gradle/actions/commits
uses: gradle/actions/setup-gradle@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2
with:
cache-read-only: true
- name: Build Geyser - name: Build Geyser
# See https://github.com/gradle/actions/commits run: ./gradlew build
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
with:
arguments: build
build-root-directory: geyser
cache-read-only: true
- name: Archive artifacts (Geyser Fabric) - name: Archive artifacts (Geyser Fabric)
# See https://github.com/actions/upload-artifact/commits # See https://github.com/actions/upload-artifact/commits
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
if: success() if: success()
with: with:
name: Geyser Fabric name: Geyser Fabric
path: geyser/bootstrap/mod/fabric/build/libs/Geyser-Fabric.jar path: geyser/bootstrap/mod/fabric/build/libs/Geyser-Fabric.jar
if-no-files-found: error if-no-files-found: error
- name: Archive artifacts (Geyser NeoForge) - name: Archive artifacts (Geyser NeoForge)
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
if: success() if: success()
with: with:
name: Geyser NeoForge name: Geyser NeoForge
path: geyser/bootstrap/mod/neoforge/build/libs/Geyser-NeoForge.jar path: geyser/bootstrap/mod/neoforge/build/libs/Geyser-NeoForge.jar
if-no-files-found: error if-no-files-found: error
- name: Archive artifacts (Geyser Standalone) - name: Archive artifacts (Geyser Standalone)
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
if: success() if: success()
with: with:
name: Geyser Standalone name: Geyser Standalone
path: geyser/bootstrap/standalone/build/libs/Geyser-Standalone.jar path: geyser/bootstrap/standalone/build/libs/Geyser-Standalone.jar
if-no-files-found: error if-no-files-found: error
- name: Archive artifacts (Geyser Spigot) - name: Archive artifacts (Geyser Spigot)
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
if: success() if: success()
with: with:
name: Geyser Spigot name: Geyser Spigot
path: geyser/bootstrap/spigot/build/libs/Geyser-Spigot.jar path: geyser/bootstrap/spigot/build/libs/Geyser-Spigot.jar
if-no-files-found: error if-no-files-found: error
- name: Archive artifacts (Geyser BungeeCord) - name: Archive artifacts (Geyser BungeeCord)
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
if: success() if: success()
with: with:
name: Geyser BungeeCord name: Geyser BungeeCord
path: geyser/bootstrap/bungeecord/build/libs/Geyser-BungeeCord.jar path: geyser/bootstrap/bungeecord/build/libs/Geyser-BungeeCord.jar
if-no-files-found: error if-no-files-found: error
- name: Archive artifacts (Geyser Velocity) - name: Archive artifacts (Geyser Velocity)
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
if: success() if: success()
with: with:
name: Geyser Velocity name: Geyser Velocity
path: geyser/bootstrap/velocity/build/libs/Geyser-Velocity.jar path: geyser/bootstrap/velocity/build/libs/Geyser-Velocity.jar
if-no-files-found: error if-no-files-found: error
- name: Archive artifacts (Geyser ViaProxy) - name: Archive artifacts (Geyser ViaProxy)
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
if: success() if: success()
with: with:
name: Geyser ViaProxy name: Geyser ViaProxy

Datei anzeigen

@ -21,84 +21,86 @@ on:
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
PROJECT: 'geyser'
steps: steps:
- name: Set Build Number - name: Get Release Info
env: id: release-info
BUILD_JSON: ${{ vars.RELEASEACTION_PREVRELEASE }} uses: GeyserMC/actions/previous-release@master
run: | with:
BUILD_NUMBER=$(echo $BUILD_JSON | jq --arg branch "${GITHUB_REF_NAME}" 'if .[$branch] == null then 1 else .[$branch] | .t | tonumber + 1 end // 1') data: ${{ vars.RELEASEACTION_PREVRELEASE }}
echo "BUILD_NUMBER=${BUILD_NUMBER:=$GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
- name: Checkout repository and submodules - name: Checkout repository and submodules
# See https://github.com/actions/checkout/commits # See https://github.com/actions/checkout/commits
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with: with:
submodules: recursive submodules: recursive
- name: Validate Gradle Wrapper - name: Validate Gradle Wrapper
# See https://github.com/gradle/wrapper-validation-action/commits # See https://github.com/gradle/actions/commits
uses: gradle/wrapper-validation-action@699bb18358f12c5b78b37bb0111d3a0e2276e0e2 # v2.1.1 uses: gradle/actions/wrapper-validation@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2
# See https://github.com/actions/setup-java/commits # See https://github.com/actions/setup-java/commits
- uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0 - name: Setup Java
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with: with:
java-version: 21 java-version: 21
distribution: temurin distribution: temurin
- name: Build - name: Setup Gradle
# See https://github.com/gradle/actions/commits # See https://github.com/gradle/actions/commits
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 uses: gradle/actions/setup-gradle@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2
with: with:
arguments: build
gradle-home-cache-cleanup: true gradle-home-cache-cleanup: true
- name: Build Geyser
run: ./gradlew build
env:
BUILD_NUMBER: ${{ steps.release-info.outputs.curentRelease }}
- name: Archive artifacts (Geyser Fabric) - name: Archive artifacts (Geyser Fabric)
# See https://github.com/actions/upload-artifact/commits # See https://github.com/actions/upload-artifact/commits
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
if: success() if: success()
with: with:
name: Geyser Fabric name: Geyser Fabric
path: bootstrap/mod/fabric/build/libs/Geyser-Fabric.jar path: bootstrap/mod/fabric/build/libs/Geyser-Fabric.jar
if-no-files-found: error if-no-files-found: error
- name: Archive artifacts (Geyser NeoForge) - name: Archive artifacts (Geyser NeoForge)
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
if: success() if: success()
with: with:
name: Geyser NeoForge name: Geyser NeoForge
path: bootstrap/mod/neoforge/build/libs/Geyser-NeoForge.jar path: bootstrap/mod/neoforge/build/libs/Geyser-NeoForge.jar
if-no-files-found: error if-no-files-found: error
- name: Archive artifacts (Geyser Standalone) - name: Archive artifacts (Geyser Standalone)
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
if: success() if: success()
with: with:
name: Geyser Standalone name: Geyser Standalone
path: bootstrap/standalone/build/libs/Geyser-Standalone.jar path: bootstrap/standalone/build/libs/Geyser-Standalone.jar
if-no-files-found: error if-no-files-found: error
- name: Archive artifacts (Geyser Spigot) - name: Archive artifacts (Geyser Spigot)
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
if: success() if: success()
with: with:
name: Geyser Spigot name: Geyser Spigot
path: bootstrap/spigot/build/libs/Geyser-Spigot.jar path: bootstrap/spigot/build/libs/Geyser-Spigot.jar
if-no-files-found: error if-no-files-found: error
- name: Archive artifacts (Geyser BungeeCord) - name: Archive artifacts (Geyser BungeeCord)
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
if: success() if: success()
with: with:
name: Geyser BungeeCord name: Geyser BungeeCord
path: bootstrap/bungeecord/build/libs/Geyser-BungeeCord.jar path: bootstrap/bungeecord/build/libs/Geyser-BungeeCord.jar
if-no-files-found: error if-no-files-found: error
- name: Archive artifacts (Geyser Velocity) - name: Archive artifacts (Geyser Velocity)
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
if: success() if: success()
with: with:
name: Geyser Velocity name: Geyser Velocity
path: bootstrap/velocity/build/libs/Geyser-Velocity.jar path: bootstrap/velocity/build/libs/Geyser-Velocity.jar
if-no-files-found: error if-no-files-found: error
- name: Archive artifacts (Geyser ViaProxy) - name: Archive artifacts (Geyser ViaProxy)
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
if: success() if: success()
with: with:
name: Geyser ViaProxy name: Geyser ViaProxy
@ -107,17 +109,23 @@ jobs:
- name: Publish to Maven Repository - name: Publish to Maven Repository
if: ${{ success() && github.repository == 'GeyserMC/Geyser' && github.ref_name == 'master' }} if: ${{ success() && github.repository == 'GeyserMC/Geyser' && github.ref_name == 'master' }}
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 run: ./gradlew publish
env: env:
BUILD_NUMBER: ${{ steps.release-info.outputs.curentRelease }}
ORG_GRADLE_PROJECT_geysermcUsername: ${{ vars.DEPLOY_USER }} ORG_GRADLE_PROJECT_geysermcUsername: ${{ vars.DEPLOY_USER }}
ORG_GRADLE_PROJECT_geysermcPassword: ${{ secrets.DEPLOY_PASS }} ORG_GRADLE_PROJECT_geysermcPassword: ${{ secrets.DEPLOY_PASS }}
with:
arguments: publish - name: Get Version
if: ${{ success() && github.repository == 'GeyserMC/Geyser' && github.ref_name == 'master' }}
id: get-version
run: |
version=$(cat gradle.properties | grep -o "version=[0-9\\.]*" | cut -d"=" -f2)
echo "VERSION=${version}" >> $GITHUB_OUTPUT
- name: Get Release Metadata - name: Get Release Metadata
if: ${{ success() && github.repository == 'GeyserMC/Geyser' && github.ref_name == 'master' }} if: ${{ success() && github.repository == 'GeyserMC/Geyser' && github.ref_name == 'master' }}
# See https://github.com/Kas-tle/base-release-action/releases/tag/main-11 uses: GeyserMC/actions/release@master
uses: Kas-tle/base-release-action@b863fa0f89bd15267a96a72efb84aec25f168d4c # main-11 id: metadata
with: with:
appID: ${{ secrets.RELEASE_APP_ID }} appID: ${{ secrets.RELEASE_APP_ID }}
appPrivateKey: ${{ secrets.RELEASE_APP_PK }} appPrivateKey: ${{ secrets.RELEASE_APP_PK }}
@ -131,61 +139,42 @@ jobs:
viaproxy:bootstrap/viaproxy/build/libs/Geyser-ViaProxy.jar viaproxy:bootstrap/viaproxy/build/libs/Geyser-ViaProxy.jar
releaseEnabled: false releaseEnabled: false
saveMetadata: true saveMetadata: true
- name: Update Generated Metadata releaseProject: 'geyser'
if: ${{ success() && github.repository == 'GeyserMC/Geyser' && github.ref_name == 'master' }} releaseVersion: ${{ steps.get-version.outputs.VERSION }}
run: |
cat metadata.json
echo
mv metadata.json metadata.json.tmp
version=$(cat gradle.properties | grep -o "version=[0-9\\.]*" | cut -d"=" -f2)
jq --arg project "${PROJECT}" --arg version "${version}" '
.
| .changes |= map({"commit", "summary", "message"})
| .downloads |= map_values({"name", "sha256"})
| {$project, "repo", $version, "number": .build, "changes", "downloads"}
' metadata.json.tmp > metadata.json
cat metadata.json
- name: Publish to Downloads API - name: Publish to Downloads API
if: ${{ success() && github.repository == 'GeyserMC/Geyser' && github.ref_name == 'master' }} if: ${{ success() && github.repository == 'GeyserMC/Geyser' && github.ref_name == 'master' }}
shell: bash uses: GeyserMC/actions/upload-release@master
env: with:
DOWNLOADS_USERNAME: ${{ vars.DOWNLOADS_USERNAME }} username: ${{ vars.DOWNLOADS_USERNAME }}
DOWNLOADS_PRIVATE_KEY: ${{ secrets.DOWNLOADS_PRIVATE_KEY }} privateKey: ${{ secrets.DOWNLOADS_PRIVATE_KEY }}
DOWNLOADS_SERVER_IP: ${{ secrets.DOWNLOADS_SERVER_IP }} host: ${{ secrets.DOWNLOADS_SERVER_IP }}
run: | files: |
# Save the private key to a file bootstrap/bungeecord/build/libs/Geyser-BungeeCord.jar
echo "$DOWNLOADS_PRIVATE_KEY" > id_ecdsa bootstrap/mod/fabric/build/libs/Geyser-Fabric.jar
chmod 600 id_ecdsa bootstrap/mod/neoforge/build/libs/Geyser-NeoForge.jar
# Create the build folder bootstrap/spigot/build/libs/Geyser-Spigot.jar
ssh -o StrictHostKeyChecking=no -i id_ecdsa $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP mkdir -p "~/uploads/$PROJECT/$GITHUB_RUN_NUMBER/" bootstrap/standalone/build/libs/Geyser-Standalone.jar
# Copy over artifacts bootstrap/velocity/build/libs/Geyser-Velocity.jar
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/ bootstrap/viaproxy/build/libs/Geyser-ViaProxy.jar
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/
# Run the build script
rsync -P -e "ssh -o StrictHostKeyChecking=no -i id_ecdsa" metadata.json $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP:~/uploads/$PROJECT/$GITHUB_RUN_NUMBER/
- name: Publish to Modrinth (Fabric) - name: Publish to Modrinth (Fabric)
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5
if: ${{ success() && github.repository == 'GeyserMC/Geyser' && github.ref_name == 'master' }} if: ${{ success() && github.repository == 'GeyserMC/Geyser' && github.ref_name == 'master' }}
env: env:
BUILD_NUMBER: ${{ steps.release-info.outputs.curentRelease }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
with: run: ./gradlew fabric:modrinth
arguments: fabric:modrinth
gradle-home-cache-cleanup: true
- name: Publish to Modrinth (NeoForge) - name: Publish to Modrinth (NeoForge)
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5
if: ${{ success() && github.repository == 'GeyserMC/Geyser' && github.ref_name == 'master' }} if: ${{ success() && github.repository == 'GeyserMC/Geyser' && github.ref_name == 'master' }}
env: env:
BUILD_NUMBER: ${{ steps.release-info.outputs.curentRelease }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
with: run: ./gradlew neoforge:modrinth
arguments: neoforge:modrinth
gradle-home-cache-cleanup: true
- name: Notify Discord - name: Notify Discord
if: ${{ (success() || failure()) && github.repository == 'GeyserMC/Geyser' }} if: ${{ (success() || failure()) && github.repository == 'GeyserMC/Geyser' }}
# See https://github.com/Tim203/actions-git-discord-webhook/commits uses: GeyserMC/actions/notify-discord@master
uses: Tim203/actions-git-discord-webhook@70f38ded3aca51635ec978ab4e1a58cd4cd0c2ff
with: with:
webhook_url: ${{ secrets.DISCORD_WEBHOOK }} discordWebhook: ${{ secrets.DISCORD_WEBHOOK }}
status: ${{ job.status }} status: ${{ job.status }}
body: ${{ steps.metadata.outputs.body }}

Datei anzeigen

@ -26,30 +26,30 @@ on:
jobs: jobs:
upload: upload:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
PROJECT: 'geyserpreview'
steps: steps:
- name: Set Variables - name: Set Variables
id: setvars id: setvars
run: | run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "BUILD=${{ github.event.inputs.build }}" >> $GITHUB_ENV echo "BUILD=${{ github.event.inputs.build }}" >> $GITHUB_ENV
echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
echo "RUN=${{ github.event.inputs.runId }}" >> $GITHUB_OUTPUT echo "RUN=${{ github.event.inputs.runId }}" >> $GITHUB_OUTPUT
else else
echo "BUILD=${{ inputs.build }}" >> $GITHUB_ENV echo "BUILD=${{ inputs.build }}" >> $GITHUB_ENV
echo "VERSION=${{ inputs.version }}" >> $GITHUB_ENV echo "VERSION=${{ inputs.version }}" >> $GITHUB_OUTPUT
echo "RUN=${{ github.run_id }}" >> $GITHUB_OUTPUT echo "RUN=${{ github.run_id }}" >> $GITHUB_OUTPUT
fi fi
- uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 - name: Download Artifacts
# See https://github.com/actions/download-artifact/commits
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.6
with: with:
run-id: ${{ steps.setvars.outputs.RUN }} run-id: ${{ steps.setvars.outputs.RUN }}
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
merge-multiple: true merge-multiple: true
- name: Get Preview Metadata - name: Get Preview Metadata
if: success() if: success()
# See https://github.com/Kas-tle/base-release-action/releases/tag/main-11 uses: GeyserMC/actions/release@master
uses: Kas-tle/base-release-action@664c39985eb9d0d393ce98e7eb8414d3d98e762a # main-11 id: metadata
with: with:
appID: ${{ secrets.RELEASE_APP_ID }} appID: ${{ secrets.RELEASE_APP_ID }}
appPrivateKey: ${{ secrets.RELEASE_APP_PK }} appPrivateKey: ${{ secrets.RELEASE_APP_PK }}
@ -64,33 +64,20 @@ jobs:
releaseEnabled: false releaseEnabled: false
saveMetadata: true saveMetadata: true
updateReleaseData: false updateReleaseData: false
- name: Update Generated Metadata releaseProject: 'geyserpreview'
if: success() releaseVersion: ${{ steps.setvars.outputs.VERSION }}
run: |
cat metadata.json
echo
mv metadata.json metadata.json.tmp
jq --arg project "${PROJECT}" --arg version "${VERSION}" --arg number "${BUILD}" '
.
| .downloads |= map_values({"name", "sha256"})
| {$project, "repo", $version, "number": $number | tonumber, "changes": [], "downloads"}
' metadata.json.tmp > metadata.json
cat metadata.json
- name: Publish to Downloads API - name: Publish to Downloads API
if: success() if: success()
shell: bash uses: GeyserMC/actions/upload-release@master
env: with:
DOWNLOADS_USERNAME: ${{ vars.DOWNLOADS_USERNAME }} username: ${{ vars.DOWNLOADS_USERNAME }}
DOWNLOADS_PRIVATE_KEY: ${{ secrets.DOWNLOADS_PRIVATE_KEY }} privateKey: ${{ secrets.DOWNLOADS_PRIVATE_KEY }}
DOWNLOADS_SERVER_IP: ${{ secrets.DOWNLOADS_SERVER_IP }} host: ${{ secrets.DOWNLOADS_SERVER_IP }}
run: | files: |
# Save the private key to a file Geyser-BungeeCord.jar
echo "$DOWNLOADS_PRIVATE_KEY" > id_ecdsa Geyser-Fabric.jar
chmod 600 id_ecdsa Geyser-NeoForge.jar
# Create the build folder Geyser-Spigot.jar
ssh -o StrictHostKeyChecking=no -i id_ecdsa $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP mkdir -p "~/uploads/$PROJECT/$BUILD/" Geyser-Standalone.jar
# Copy over artifacts Geyser-Velocity.jar
rsync -P -e "ssh -o StrictHostKeyChecking=no -i id_ecdsa" Geyser-*.jar $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP:~/uploads/$PROJECT/$BUILD/ Geyser-ViaProxy.jar
# Run the build script
# Push the metadata
rsync -P -e "ssh -o StrictHostKeyChecking=no -i id_ecdsa" metadata.json $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP:~/uploads/$PROJECT/$BUILD/