Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-11-14 12:00:08 +01:00
cf27b88cc8
* Switch to centralized GitHub actions * Update PR actions as well * Publish preview only if success * Webhook on success & failure
84 Zeilen
2.9 KiB
YAML
84 Zeilen
2.9 KiB
YAML
name: Upload Preview
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
runId:
|
|
required: true
|
|
description: 'ID of the action to pull artifacts from'
|
|
build:
|
|
required: true
|
|
description: 'Build number for the release'
|
|
version:
|
|
required: true
|
|
description: 'Version under which to upload to the Downloads API'
|
|
workflow_call:
|
|
inputs:
|
|
build:
|
|
required: true
|
|
description: 'Build number for the release'
|
|
type: string
|
|
version:
|
|
required: true
|
|
description: 'Version under which to upload to the Downloads API'
|
|
type: string
|
|
|
|
jobs:
|
|
upload:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Set Variables
|
|
id: setvars
|
|
run: |
|
|
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
|
|
echo "BUILD=${{ github.event.inputs.build }}" >> $GITHUB_ENV
|
|
echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
|
|
echo "RUN=${{ github.event.inputs.runId }}" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "BUILD=${{ inputs.build }}" >> $GITHUB_ENV
|
|
echo "VERSION=${{ inputs.version }}" >> $GITHUB_OUTPUT
|
|
echo "RUN=${{ github.run_id }}" >> $GITHUB_OUTPUT
|
|
fi
|
|
- name: Download Artifacts
|
|
# See https://github.com/actions/download-artifact/commits
|
|
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.6
|
|
with:
|
|
run-id: ${{ steps.setvars.outputs.RUN }}
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
merge-multiple: true
|
|
- name: Get Preview Metadata
|
|
if: success()
|
|
uses: GeyserMC/actions/release@master
|
|
id: metadata
|
|
with:
|
|
appID: ${{ secrets.RELEASE_APP_ID }}
|
|
appPrivateKey: ${{ secrets.RELEASE_APP_PK }}
|
|
files: |
|
|
bungeecord:Geyser-BungeeCord.jar
|
|
fabric:Geyser-Fabric.jar
|
|
neoforge:Geyser-NeoForge.jar
|
|
spigot:Geyser-Spigot.jar
|
|
standalone:Geyser-Standalone.jar
|
|
velocity:Geyser-Velocity.jar
|
|
viaproxy:Geyser-ViaProxy.jar
|
|
releaseEnabled: false
|
|
saveMetadata: true
|
|
updateReleaseData: false
|
|
releaseProject: 'geyserpreview'
|
|
releaseVersion: ${{ steps.setvars.outputs.VERSION }}
|
|
- name: Publish to Downloads API
|
|
if: success()
|
|
uses: GeyserMC/actions/upload-release@master
|
|
with:
|
|
username: ${{ vars.DOWNLOADS_USERNAME }}
|
|
privateKey: ${{ secrets.DOWNLOADS_PRIVATE_KEY }}
|
|
host: ${{ secrets.DOWNLOADS_SERVER_IP }}
|
|
files: |
|
|
Geyser-BungeeCord.jar
|
|
Geyser-Fabric.jar
|
|
Geyser-NeoForge.jar
|
|
Geyser-Spigot.jar
|
|
Geyser-Standalone.jar
|
|
Geyser-Velocity.jar
|
|
Geyser-ViaProxy.jar
|