1
0
mirror of https://github.com/GeyserMC/Floodgate.git synced 2025-12-19 14:59:20 +00:00

Add publishing to downloads site (#385)

* Add publishing to downloads site

* Only publish to Downloads API when branch is master and status success

---------

Co-authored-by: Tim203 <mctim203@gmail.com>
This commit is contained in:
rtm516
2023-02-13 21:01:37 +00:00
committed by GitHub
parent 7ea41b2648
commit 64b1d9c108

View File

@@ -22,10 +22,30 @@ jobs:
with:
arguments: build
- name: Publish
- name: Publish to Maven Repository
uses: gradle/gradle-build-action@v2
env:
ORG_GRADLE_PROJECT_geysermcUsername: ${{ vars.DEPLOY_USER }}
ORG_GRADLE_PROJECT_geysermcPassword: ${{ secrets.DEPLOY_PASS }}
with:
arguments: publish
- name: Publish to Downloads API
if: ${{ github.ref_name == "master" && job.status == "success" }}
shell: bash
run: |
# Save the private key to a file
echo "$DOWNLOADS_PRIVATE_KEY" > id_ecdsa
chmod 600 id_ecdsa
# Get the version from gradle.properties
version=$(cat gradle.properties | grep -o "version=[0-9\\.]*" | cut -d"=" -f2)
# Copy over artifacts
scp -B -o StrictHostKeyChecking=no -i id_ecdsa **/build/libs/floodgate-*.jar $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP:~/files/
# Remove un-needed artifacts
ssh -o StrictHostKeyChecking=no -i id_ecdsa $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP rm ~/files/floodgate-parent-*.jar ~/files/floodgate-api.jar ~/files/floodgate-core.jar
# Run the build script
ssh -o StrictHostKeyChecking=no -i id_ecdsa $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP ./handleBuild.sh floodgate $version $GITHUB_RUN_ID $GITHUB_SHA