mirror of
https://github.com/GeyserMC/GeyserConnect.git
synced 2025-06-26 14:15:22 +02:00
Publish to downloads API
This commit is contained in:
parent
bdbe73b461
commit
4459a63c53
1 changed files with 24 additions and 0 deletions
24
.github/workflows/build.yml
vendored
24
.github/workflows/build.yml
vendored
|
@ -35,3 +35,27 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: GeyserConnect
|
name: GeyserConnect
|
||||||
path: build/libs/GeyserConnect.jar
|
path: build/libs/GeyserConnect.jar
|
||||||
|
|
||||||
|
- name: Publish to Downloads API
|
||||||
|
if: ${{ success() && github.repository == 'GeyserMC/GeyserConnect' && github.ref_name == 'master' }}
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
DOWNLOADS_USERNAME: ${{ vars.DOWNLOADS_USERNAME }}
|
||||||
|
DOWNLOADS_PRIVATE_KEY: ${{ secrets.DOWNLOADS_PRIVATE_KEY }}
|
||||||
|
DOWNLOADS_SERVER_IP: ${{ secrets.DOWNLOADS_SERVER_IP }}
|
||||||
|
run: |
|
||||||
|
# Save the private key to a file
|
||||||
|
echo "$DOWNLOADS_PRIVATE_KEY" > id_ecdsa
|
||||||
|
chmod 600 id_ecdsa
|
||||||
|
# Set the project
|
||||||
|
project=geyserconnect
|
||||||
|
# Get the version from gradle.properties
|
||||||
|
version=$(cat build.gradle | grep -o "version '[0-9\\.]*'" | cut -d" " -f2 | sed "s/'//g")
|
||||||
|
# Create the build folder
|
||||||
|
ssh -o StrictHostKeyChecking=no -i id_ecdsa $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP mkdir -p "~/uploads/$project/$GITHUB_RUN_NUMBER/"
|
||||||
|
# Copy over artifacts
|
||||||
|
rsync -P -e "ssh -o StrictHostKeyChecking=no -i id_ecdsa" build/libs/GeyserConnect.jar $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP:~/uploads/$project/$GITHUB_RUN_NUMBER/
|
||||||
|
# Run the build script
|
||||||
|
# Push the metadata
|
||||||
|
echo "{\"project\": \"$project\", \"version\": \"$version\", \"id\": $GITHUB_RUN_NUMBER, \"commit\": \"$GITHUB_SHA\"}" > metadata.json
|
||||||
|
rsync -P -e "ssh -o StrictHostKeyChecking=no -i id_ecdsa" metadata.json $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP:~/uploads/$project/$GITHUB_RUN_NUMBER/
|
||||||
|
|
Loading…
Add table
Reference in a new issue