-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (48 loc) · 1.45 KB
/
build.yml
File metadata and controls
51 lines (48 loc) · 1.45 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
name: Build modpack
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches: [ main ]
tags: [ 'v*' ]
workflow_dispatch:
jobs:
build:
if: |
github.event_name == 'workflow_dispatch' ||
startsWith(github.ref, 'refs/tags/') ||
startsWith(github.event.head_commit.message, '[build]')
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Cache mod jars
uses: actions/cache@v4
with:
path: minecraft/mods
key: mods-${{ hashFiles('minecraft/mods/.index/**') }}
restore-keys: mods-
- name: Restore .index from git (cache may have stale metadata)
run: git checkout -- minecraft/mods/.index/
- name: Download mods
run: python download_mods.py
- name: Build modpack
run: python compile.py
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: modpack
path: build/modpack-latest.zip
- name: Create GitHub release
if: startsWith(github.ref, 'refs/tags/')
uses: ncipollo/release-action@v1
with:
tag: ${{ github.ref_name }}
name: ${{ github.ref_name }}
token: ${{ secrets.PAT }}
artifacts: build/modpack-latest.zip
allowUpdates: true