-
Notifications
You must be signed in to change notification settings - Fork 1
90 lines (76 loc) · 2.48 KB
/
fetch-mc-forge.yml
File metadata and controls
90 lines (76 loc) · 2.48 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Fetch Forge
on:
workflow_dispatch:
schedule:
- cron: "0 2 * * *"
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
build-forge: # Fixed: was named build-spigot (copy-paste error)
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
version:
- "1.17.1"
- "1.18"
- "1.18.1"
- "1.18.2"
- "1.19"
- "1.19.1"
- "1.19.2"
- "1.19.3"
- "1.19.4"
- "1.20"
- "1.20.1"
- "1.20.2"
- "1.20.3"
- "1.20.4"
- "1.20.6"
- "1.21.1"
- "1.21.3"
- "1.21.4"
- "1.21.5"
- "1.21.6"
- "1.21.7"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "^1.21"
- name: Install pup
run: go install github.com/ericchiang/pup@latest
- name: Fetch Forge ${{ matrix.version }}
run: |
set -e
export PATH=${PATH}:$(go env GOPATH)/bin
# Fetch the Forge installer link
HTML_URL="https://files.minecraftforge.net/net/minecraftforge/forge/index_${{ matrix.version }}.html"
echo "Fetching from: $HTML_URL"
LINK=$(curl -s --max-time 30 "$HTML_URL" | \
pup ':parent-of(.classifier-installer) json{}' | \
jq -r 'first(.[] | select(.href != null) | .href)' | \
sed 's/^.*https:\/\/maven.minecraftforge.net/https:\/\/maven.minecraftforge.net/')
if [ -z "$LINK" ]; then
echo "::error::Failed to find Forge download link for version ${{ matrix.version }}"
exit 1
fi
echo "Downloading from: $LINK"
wget --timeout=120 --tries=3 -O forge-${{ matrix.version }}.jar "$LINK"
mkdir -p forge
ls -la forge-${{ matrix.version }}.jar
- name: Upload to S3
uses: jakejarvis/s3-sync-action@master
with:
args: --follow-symlinks
env:
AWS_S3_BUCKET: ${{ secrets.PRESIGN_BUCKET_NAME }}
AWS_ACCESS_KEY_ID: ${{ secrets.PRESIGN_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.PRESIGN_SECRET_KEY }}
AWS_S3_ENDPOINT: http://${{ secrets.PRESIGN_S3_ENDPOINT }}
AWS_REGION: "fsn1"
SOURCE_DIR: forge
DEST_DIR: minecraft/forge