mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Composite gradle setup and artifact archival (#4696)
* Composite gradle setup and artifact archival * Remove 'geyser' path for PRs * Move upload-preview workflow
This commit is contained in:
parent
cf27b88cc8
commit
fe63665d88
5 changed files with 77 additions and 226 deletions
85
.github/workflows/build-remote.yml
vendored
85
.github/workflows/build-remote.yml
vendored
|
@ -22,81 +22,26 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
echo "BUILD_NUMBER=${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
|
echo "BUILD_NUMBER=${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Setup Java
|
|
||||||
# See https://github.com/actions/setup-java/commits
|
|
||||||
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
|
|
||||||
with:
|
|
||||||
java-version: 21
|
|
||||||
distribution: temurin
|
|
||||||
|
|
||||||
- name: Checkout repository and submodules
|
|
||||||
# See https://github.com/actions/checkout/commits
|
|
||||||
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
|
||||||
with:
|
|
||||||
repository: ${{ inputs.repository }}
|
|
||||||
ref: ${{ inputs.ref }}
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Validate Gradle Wrapper
|
|
||||||
# See https://github.com/gradle/wrapper-validation-action/commits
|
|
||||||
uses: gradle/actions/wrapper-validation@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2
|
|
||||||
|
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
# See https://github.com/gradle/actions/commits
|
uses: GeyserMC/actions/setup-gradle-composite@master
|
||||||
uses: gradle/actions/setup-gradle@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2
|
|
||||||
with:
|
with:
|
||||||
cache-read-only: true
|
checkout_repository: ${{ inputs.repository }}
|
||||||
|
checkout_ref: ${{ inputs.ref }}
|
||||||
|
setup-java_java-version: 21
|
||||||
|
setup-gradle_cache-read-only: true
|
||||||
|
|
||||||
- name: Build Geyser
|
- name: Build Geyser
|
||||||
run: ./gradlew build
|
run: ./gradlew build
|
||||||
|
|
||||||
- name: Archive artifacts (Geyser Fabric)
|
- name: Archive Artifacts
|
||||||
# See https://github.com/actions/upload-artifact/commits
|
uses: GeyserMC/actions/upload-multi-artifact@master
|
||||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
|
||||||
if: success()
|
if: success()
|
||||||
with:
|
with:
|
||||||
name: Geyser Fabric
|
artifacts: |
|
||||||
path: geyser/bootstrap/mod/fabric/build/libs/Geyser-Fabric.jar
|
bootstrap/mod/fabric/build/libs/Geyser-Fabric.jar
|
||||||
if-no-files-found: error
|
bootstrap/mod/neoforge/build/libs/Geyser-NeoForge.jar
|
||||||
- name: Archive artifacts (Geyser NeoForge)
|
bootstrap/standalone/build/libs/Geyser-Standalone.jar
|
||||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
|
bootstrap/spigot/build/libs/Geyser-Spigot.jar
|
||||||
if: success()
|
bootstrap/bungeecord/build/libs/Geyser-BungeeCord.jar
|
||||||
with:
|
bootstrap/velocity/build/libs/Geyser-Velocity.jar
|
||||||
name: Geyser NeoForge
|
bootstrap/viaproxy/build/libs/Geyser-ViaProxy.jar
|
||||||
path: geyser/bootstrap/mod/neoforge/build/libs/Geyser-NeoForge.jar
|
|
||||||
if-no-files-found: error
|
|
||||||
- name: Archive artifacts (Geyser Standalone)
|
|
||||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
|
|
||||||
if: success()
|
|
||||||
with:
|
|
||||||
name: Geyser Standalone
|
|
||||||
path: geyser/bootstrap/standalone/build/libs/Geyser-Standalone.jar
|
|
||||||
if-no-files-found: error
|
|
||||||
- name: Archive artifacts (Geyser Spigot)
|
|
||||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
|
|
||||||
if: success()
|
|
||||||
with:
|
|
||||||
name: Geyser Spigot
|
|
||||||
path: geyser/bootstrap/spigot/build/libs/Geyser-Spigot.jar
|
|
||||||
if-no-files-found: error
|
|
||||||
- name: Archive artifacts (Geyser BungeeCord)
|
|
||||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
|
|
||||||
if: success()
|
|
||||||
with:
|
|
||||||
name: Geyser BungeeCord
|
|
||||||
path: geyser/bootstrap/bungeecord/build/libs/Geyser-BungeeCord.jar
|
|
||||||
if-no-files-found: error
|
|
||||||
- name: Archive artifacts (Geyser Velocity)
|
|
||||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
|
|
||||||
if: success()
|
|
||||||
with:
|
|
||||||
name: Geyser Velocity
|
|
||||||
path: geyser/bootstrap/velocity/build/libs/Geyser-Velocity.jar
|
|
||||||
if-no-files-found: error
|
|
||||||
- name: Archive artifacts (Geyser ViaProxy)
|
|
||||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
|
|
||||||
if: success()
|
|
||||||
with:
|
|
||||||
name: Geyser ViaProxy
|
|
||||||
path: geyser/bootstrap/viaproxy/build/libs/Geyser-ViaProxy.jar
|
|
||||||
if-no-files-found: error
|
|
86
.github/workflows/build.yml
vendored
86
.github/workflows/build.yml
vendored
|
@ -28,84 +28,28 @@ jobs:
|
||||||
with:
|
with:
|
||||||
data: ${{ vars.RELEASEACTION_PREVRELEASE }}
|
data: ${{ vars.RELEASEACTION_PREVRELEASE }}
|
||||||
|
|
||||||
- name: Checkout repository and submodules
|
|
||||||
# See https://github.com/actions/checkout/commits
|
|
||||||
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Validate Gradle Wrapper
|
|
||||||
# See https://github.com/gradle/actions/commits
|
|
||||||
uses: gradle/actions/wrapper-validation@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2
|
|
||||||
|
|
||||||
# See https://github.com/actions/setup-java/commits
|
|
||||||
- name: Setup Java
|
|
||||||
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
|
|
||||||
with:
|
|
||||||
java-version: 21
|
|
||||||
distribution: temurin
|
|
||||||
|
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
# See https://github.com/gradle/actions/commits
|
uses: GeyserMC/actions/setup-gradle-composite@master
|
||||||
uses: gradle/actions/setup-gradle@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2
|
|
||||||
with:
|
with:
|
||||||
gradle-home-cache-cleanup: true
|
setup-java_java-version: 21
|
||||||
|
|
||||||
- name: Build Geyser
|
- name: Build Geyser
|
||||||
run: ./gradlew build
|
run: ./gradlew build
|
||||||
env:
|
env:
|
||||||
BUILD_NUMBER: ${{ steps.release-info.outputs.curentRelease }}
|
BUILD_NUMBER: ${{ steps.release-info.outputs.curentRelease }}
|
||||||
|
|
||||||
- name: Archive artifacts (Geyser Fabric)
|
- name: Archive Artifacts
|
||||||
# See https://github.com/actions/upload-artifact/commits
|
uses: GeyserMC/actions/upload-multi-artifact@master
|
||||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
|
||||||
if: success()
|
if: success()
|
||||||
with:
|
with:
|
||||||
name: Geyser Fabric
|
artifacts: |
|
||||||
path: bootstrap/mod/fabric/build/libs/Geyser-Fabric.jar
|
bootstrap/mod/fabric/build/libs/Geyser-Fabric.jar
|
||||||
if-no-files-found: error
|
bootstrap/mod/neoforge/build/libs/Geyser-NeoForge.jar
|
||||||
- name: Archive artifacts (Geyser NeoForge)
|
bootstrap/standalone/build/libs/Geyser-Standalone.jar
|
||||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
|
bootstrap/spigot/build/libs/Geyser-Spigot.jar
|
||||||
if: success()
|
bootstrap/bungeecord/build/libs/Geyser-BungeeCord.jar
|
||||||
with:
|
bootstrap/velocity/build/libs/Geyser-Velocity.jar
|
||||||
name: Geyser NeoForge
|
bootstrap/viaproxy/build/libs/Geyser-ViaProxy.jar
|
||||||
path: bootstrap/mod/neoforge/build/libs/Geyser-NeoForge.jar
|
|
||||||
if-no-files-found: error
|
|
||||||
- name: Archive artifacts (Geyser Standalone)
|
|
||||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
|
|
||||||
if: success()
|
|
||||||
with:
|
|
||||||
name: Geyser Standalone
|
|
||||||
path: bootstrap/standalone/build/libs/Geyser-Standalone.jar
|
|
||||||
if-no-files-found: error
|
|
||||||
- name: Archive artifacts (Geyser Spigot)
|
|
||||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
|
|
||||||
if: success()
|
|
||||||
with:
|
|
||||||
name: Geyser Spigot
|
|
||||||
path: bootstrap/spigot/build/libs/Geyser-Spigot.jar
|
|
||||||
if-no-files-found: error
|
|
||||||
- name: Archive artifacts (Geyser BungeeCord)
|
|
||||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
|
|
||||||
if: success()
|
|
||||||
with:
|
|
||||||
name: Geyser BungeeCord
|
|
||||||
path: bootstrap/bungeecord/build/libs/Geyser-BungeeCord.jar
|
|
||||||
if-no-files-found: error
|
|
||||||
- name: Archive artifacts (Geyser Velocity)
|
|
||||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
|
|
||||||
if: success()
|
|
||||||
with:
|
|
||||||
name: Geyser Velocity
|
|
||||||
path: bootstrap/velocity/build/libs/Geyser-Velocity.jar
|
|
||||||
if-no-files-found: error
|
|
||||||
- name: Archive artifacts (Geyser ViaProxy)
|
|
||||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
|
|
||||||
if: success()
|
|
||||||
with:
|
|
||||||
name: Geyser ViaProxy
|
|
||||||
path: bootstrap/viaproxy/build/libs/Geyser-ViaProxy.jar
|
|
||||||
if-no-files-found: error
|
|
||||||
|
|
||||||
- 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' }}
|
||||||
|
@ -116,14 +60,14 @@ jobs:
|
||||||
ORG_GRADLE_PROJECT_geysermcPassword: ${{ secrets.DEPLOY_PASS }}
|
ORG_GRADLE_PROJECT_geysermcPassword: ${{ secrets.DEPLOY_PASS }}
|
||||||
|
|
||||||
- name: Get Version
|
- name: Get Version
|
||||||
if: ${{ success() && github.repository == 'GeyserMC/Geyser' && github.ref_name == 'master' }}
|
if: ${{ (success() || failure()) && github.repository == 'GeyserMC/Geyser' }}
|
||||||
id: get-version
|
id: get-version
|
||||||
run: |
|
run: |
|
||||||
version=$(cat gradle.properties | grep -o "version=[0-9\\.]*" | cut -d"=" -f2)
|
version=$(cat gradle.properties | grep -o "version=[0-9\\.]*" | cut -d"=" -f2)
|
||||||
echo "VERSION=${version}" >> $GITHUB_OUTPUT
|
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() || failure()) && github.repository == 'GeyserMC/Geyser' }}
|
||||||
uses: GeyserMC/actions/release@master
|
uses: GeyserMC/actions/release@master
|
||||||
id: metadata
|
id: metadata
|
||||||
with:
|
with:
|
||||||
|
@ -141,6 +85,7 @@ jobs:
|
||||||
saveMetadata: true
|
saveMetadata: true
|
||||||
releaseProject: 'geyser'
|
releaseProject: 'geyser'
|
||||||
releaseVersion: ${{ steps.get-version.outputs.VERSION }}
|
releaseVersion: ${{ steps.get-version.outputs.VERSION }}
|
||||||
|
|
||||||
- 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' }}
|
||||||
uses: GeyserMC/actions/upload-release@master
|
uses: GeyserMC/actions/upload-release@master
|
||||||
|
@ -156,6 +101,7 @@ jobs:
|
||||||
bootstrap/standalone/build/libs/Geyser-Standalone.jar
|
bootstrap/standalone/build/libs/Geyser-Standalone.jar
|
||||||
bootstrap/velocity/build/libs/Geyser-Velocity.jar
|
bootstrap/velocity/build/libs/Geyser-Velocity.jar
|
||||||
bootstrap/viaproxy/build/libs/Geyser-ViaProxy.jar
|
bootstrap/viaproxy/build/libs/Geyser-ViaProxy.jar
|
||||||
|
changelog: ${{ steps.metadata.outputs.body }}
|
||||||
|
|
||||||
- name: Publish to Modrinth (Fabric)
|
- name: Publish to Modrinth (Fabric)
|
||||||
if: ${{ success() && github.repository == 'GeyserMC/Geyser' && github.ref_name == 'master' }}
|
if: ${{ success() && github.repository == 'GeyserMC/Geyser' && github.ref_name == 'master' }}
|
||||||
|
|
33
.github/workflows/dispatch-preview.yml
vendored
Normal file
33
.github/workflows/dispatch-preview.yml
vendored
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
name: Dispatch 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'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
dispatch-preview:
|
||||||
|
# Allow access to secrets if we are uploading a preview
|
||||||
|
secrets: inherit
|
||||||
|
uses: GeyserMC/actions/.github/workflows/upload-preview.yml@master
|
||||||
|
with:
|
||||||
|
build: ${{ inputs.build }}
|
||||||
|
version: ${{ inputs.version }}
|
||||||
|
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
|
||||||
|
project: geyserpreview
|
||||||
|
runId: ${{ inputs.runId }}
|
83
.github/workflows/preview.yml
vendored
83
.github/workflows/preview.yml
vendored
|
@ -1,83 +0,0 @@
|
||||||
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
|
|
16
.github/workflows/pull-request.yml
vendored
16
.github/workflows/pull-request.yml
vendored
|
@ -8,7 +8,7 @@ jobs:
|
||||||
# Forbid access to secrets nor GH Token perms while building the PR
|
# Forbid access to secrets nor GH Token perms while building the PR
|
||||||
permissions: {}
|
permissions: {}
|
||||||
secrets: {}
|
secrets: {}
|
||||||
uses: ./.github/workflows/build-remote.yml
|
uses: GeyserMC/Geyser/.github/workflows/build-remote.yml@master
|
||||||
with:
|
with:
|
||||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
@ -18,7 +18,17 @@ jobs:
|
||||||
contains(github.event.pull_request.labels.*.name, 'PR: Needs Testing')
|
contains(github.event.pull_request.labels.*.name, 'PR: Needs Testing')
|
||||||
# Allow access to secrets if we are uploading a preview
|
# Allow access to secrets if we are uploading a preview
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
uses: ./.github/workflows/preview.yml
|
uses: GeyserMC/actions/.github/workflows/upload-preview.yml@master
|
||||||
with:
|
with:
|
||||||
build: ${{ github.run_number }}
|
build: ${{ github.run_number }}
|
||||||
version: pr.${{ github.event.pull_request.number }}
|
version: pr.${{ github.event.pull_request.number }}
|
||||||
|
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
|
||||||
|
project: geyserpreview
|
||||||
|
runId: ${{ github.run_id }}
|
Loading…
Reference in a new issue