Repository navigation
140 lines (118 loc) · 4.11 KB
/
Copy pathdeploy.yml
File metadata and controls
140 lines (118 loc) · 4.11 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: Build & Deploy Modpack
on:
# Runs on pushes targeting the default branch
push:
branches: ["main", "test"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "deploy"
cancel-in-progress: false
env:
PACKWIZ_COMMIT: ef87d964f8cbd52b3b13ea42453ef322290e2b9e
PACKWIZ_DIR: /tmp/packwiz_artifact
PACKWIZ: /tmp/packwiz_artifact/packwiz
jobs:
deploy_packwiz:
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v4
with:
ref: "main"
- name: Checkout test
uses: actions/checkout@v4
with:
ref: "test"
path: test
clean: false
# Set up dependencies
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install main python dependencies
run: pip install -r requirements.txt
- name: Install test python dependencies
run: pip install -r test/requirements.txt
- name: Cache Packwiz
id: cache-packwiz
uses: actions/cache@v4
with:
path: ${{ env.PACKWIZ_DIR }}
key: packwiz-${{ env.PACKWIZ_COMMIT }}
- if: ${{ steps.cache-packwiz.outputs.cache-hit != 'true' }}
name: Download Packwiz
uses: dawidd6/action-download-artifact@v8
with:
github_token: ${{secrets.GITHUB_TOKEN}}
repo: packwiz/packwiz
workflow: go.yml
name: "Linux 64-bit x86"
path: ${{ env.PACKWIZ_DIR }}
commit: ${{ env.PACKWIZ_COMMIT }}
allow_forks: true
- name: Make packwiz executable
run: chmod +x ${{ env.PACKWIZ }}
# Build
- name: Build main pack
run: python scripts/assemble_packwiz.py
- name: Build test pack
run: python test/scripts/assemble_packwiz.py
env:
BRANCH_OVERRIDE: test
# Setup test-runner cache
- name: Generate cache key
run: python scripts/run_test.py
env:
GENERATE_DESIRED_CACHE_STATE_AND_EXIT: true
- name: Cache test-runner (static cache)
uses: actions/cache@v4
with:
path: run/cache-static/
key: test-run-static-cache-${{ hashFiles('run/desired_cache_state_for_static_cache.json') }} # Try and get the desired state
restore-keys: test-run-static-cache- # But fall back if needed
- name: Cache test-runner (dynamic cache)
uses: actions/cache@v4
with:
path: run/cache-dynamic/
key: test-run-dynamic-cache-${{ hashFiles('generated/pack/pack.toml') }} # pack.toml contains hashes for all other files
restore-keys: test-run-dynamic-cache-
# Run tests
- uses: actions/setup-java@v4
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '25'
- name: Test main pack
run: python scripts/run_test.py
- name: Test test pack
run: python test/scripts/run_test.py
env:
BRANCH_OVERRIDE: test
- name: Build unsup
run: python scripts/assemble_unsup.py
- name: Build unsup
run: python test/scripts/assemble_unsup.py
- name: Copy test pack
run: cp -r test/generated/pack generated/pack/test
- name: Copy test unsup packs
run: cp --update=none test/generated/*.zip generated
- uses: actions/upload-artifact@v4
with:
path: generated/*.zip
- name: Configure pages
id: pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: generated/pack/
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4