GeyserConnect/.github/workflows/build.yml
2025-04-26 17:28:12 +01:00

64 lines
2.1 KiB
YAML

name: Build
on:
workflow_dispatch:
push:
paths-ignore:
- '.idea/copyright/*.xml'
- '.gitignore'
- 'LICENSE'
- 'README.md'
- 'bind9/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup Gradle
uses: GeyserMC/actions/setup-gradle-composite@master
with:
setup-java_java-version: 21
- name: Build GeyserConnect
run: ./gradlew build
- name: Archive artifacts
# See https://github.com/actions/upload-artifact/commits
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: success()
with:
name: GeyserConnect
path: build/libs/GeyserConnect.jar
if-no-files-found: error
- name: Get Version
if: ${{ success() && github.repository == 'GeyserMC/GeyserConnect' && github.ref_name == 'master' }}
id: get-version
run: |
version=$(cat build.gradle | grep -o "version '[0-9\\.]*'" | cut -d" " -f2 | sed "s/'//g")
echo "VERSION=${version}" >> $GITHUB_OUTPUT
- name: Get Release Metadata
if: ${{ success() && github.repository == 'GeyserMC/GeyserConnect' && github.ref_name == 'master' }}
uses: GeyserMC/actions/release@master
id: metadata
with:
appID: ${{ secrets.RELEASE_APP_ID }}
appPrivateKey: ${{ secrets.RELEASE_APP_PK }}
files: |
geyserconnect:build/libs/GeyserConnect.jar
releaseEnabled: false
saveMetadata: true
releaseProject: 'geyserconnect'
releaseVersion: ${{ steps.get-version.outputs.VERSION }}
- name: Publish to Downloads API
if: ${{ success() && github.repository == 'GeyserMC/GeyserConnect' && github.ref_name == 'master' }}
uses: GeyserMC/actions/upload-release@master
with:
username: ${{ vars.DOWNLOADS_USERNAME }}
privateKey: ${{ secrets.DOWNLOADS_PRIVATE_KEY }}
host: ${{ secrets.DOWNLOADS_SERVER_IP }}
files: |
build/libs/GeyserConnect.jar