Fetch PaperMC #229
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Fetch PaperMC | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 2 * * *" | |
jobs: | |
build-spigot: | |
strategy: | |
matrix: | |
version: | |
[ | |
1.17, | |
1.17.1, | |
# 1.18, Has Only experimental channel. Let's dont use it, until someone really wants it | |
1.18.1, | |
1.18.2, | |
1.19, | |
1.19.1, | |
1.19.2, | |
1.19.3, | |
1.19.4, | |
1.20.1, | |
1.20.2, | |
1.20.4, | |
1.20.6, | |
1.21.1, | |
] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Fetch latest builds | |
run: wget -O builds.json https://api.papermc.io/v2/projects/paper/versions/${{ matrix.version }}/builds | |
- name: Fetch latest stable | |
run: echo "BUILD_NUMBER=$(cat builds.json | jq '[ .builds[] | select(.channel == "default") ] | sort_by(.build) | .[-1].build')" >> $GITHUB_ENV | |
- name: Fetch Experimental if no stable found | |
run: echo "BUILD_NUMBER=$(cat builds.json | jq '[ .builds[] | select(.channel == "experimental") ] | sort_by(.build) | .[-1].build')" >> $GITHUB_ENV | |
if: env.BUILD_NUMBER == 'null' | |
- run: wget -O paper-${{ matrix.version }}.jar https://api.papermc.io/v2/projects/paper/versions/${{ matrix.version }}/builds/${{ env.BUILD_NUMBER }}/downloads/paper-${{ matrix.version }}-${{ env.BUILD_NUMBER }}.jar | |
- run: mkdir -p papermc && mv paper-${{ matrix.version }}.jar papermc/paper-${{ matrix.version }}.jar | |
- uses: jakejarvis/s3-sync-action@master | |
env: | |
AWS_S3_BUCKET: ${{ secrets.AWS_BUCKET }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_S3_ENDPOINT: https://s3.eu-central-1.wasabisys.com/ | |
AWS_REGION: "eu-central-1" | |
SOURCE_DIR: papermc | |
DEST_DIR: minecraft/papermc |