-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (48 loc) · 1.89 KB
/
fetch-papermc.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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