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:
24
.github/workflows/build.yml
vendored
24
.github/workflows/build.yml
vendored
@@ -22,10 +22,30 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
arguments: build
|
arguments: build
|
||||||
|
|
||||||
- name: Publish
|
- name: Publish to Maven Repository
|
||||||
uses: gradle/gradle-build-action@v2
|
uses: gradle/gradle-build-action@v2
|
||||||
env:
|
env:
|
||||||
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:
|
with:
|
||||||
arguments: publish
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user