-
Notifications
You must be signed in to change notification settings - Fork 54
162 lines (136 loc) · 3.84 KB
/
pyinstaller-win-shawn.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
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: dev_shawn分支自动打包
on:
push:
branches:
- dev_shawn
workflow_dispatch:
jobs:
build-frontend:
runs-on: ubuntu-22.04
steps:
- name: fetch source
uses: actions/checkout@v4
- name: setup nodejs 16
uses: actions/setup-node@v4
with:
node-version: 16
cache: "npm"
cache-dependency-path: "ui/package-lock.json"
- name: build frontend
working-directory: ui
shell: bash
run: |
npm ci
npm run build
- name: cache frontend dist
uses: actions/cache/save@v3
with:
key: frontend-dist-${{ github.sha }}
path: ui/dist
build-docs:
runs-on: ubuntu-22.04
steps:
- name: fetch source
uses: actions/checkout@v4
with:
repository: ArkMowers/arknights-mower
ref: doc-pages
- name: setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "2.7.8"
bundler-cache: true
- name: build docs
run: bundle exec jekyll build -b /docs
- name: cache docs
uses: actions/cache/save@v3
with:
key: docs-${{ github.sha }}
path: _site
build-mower:
runs-on: windows-2022
steps:
- name: download source
uses: actions/checkout@v4
- name: change version number
if: github.event.head_commit.message != '发版'
shell: bash
run: |
sed -i "s/__version__ = '\(.*\)'/__version__ = '\1+${GITHUB_SHA::7}'/g" ./arknights_mower/__init__.py
- name: install python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
cache: pip
- name: Install dependencies
shell: cmd
run: |
python -m venv venv
venv\Scripts\pip install -r requirements.txt
venv\Scripts\pip install -U pyinstaller
- name: install UPX
uses: crazy-max/ghaction-upx@v2
with:
install-only: true
- name: Make package
shell: cmd
run: |
set PYTHONHASHSEED=114514
set SOURCE_DATE_EPOCH=1694076231
venv\Scripts\pyinstaller .\webui_zip.spec --distpath=mower
- name: cache mower
uses: actions/cache/save@v3
with:
enableCrossOsArchive: true
key: mower-${{ github.sha }}
path: mower/mower
package-and-upload:
needs:
- build-frontend
- build-docs
- build-mower
runs-on: ubuntu-22.04
steps:
- name: download updater
uses: actions/checkout@v4
with:
repository: ArkMowers/updater
- name: install python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
cache: pip
- name: Install dependencies
run: |
python -m venv venv
venv/bin/pip install -U xxhash backports.zoneinfo[tzdata]
- name: restore frontend dist
uses: actions/cache/restore@v3
with:
key: frontend-dist-${{ github.sha }}
path: ui/dist
- name: restore docs
uses: actions/cache/restore@v3
with:
key: docs-${{ github.sha }}
path: _site
- name: restore mower
uses: actions/cache/restore@v3
with:
enableCrossOsArchive: true
key: mower-${{ github.sha }}
path: mower/mower
- name: merge files
run: |
mv ui/dist mower/mower/_internal/
mv _site mower/mower/_internal/dist/docs
- name: calculate hash
working-directory: mower/mower
run: ../../venv/bin/python ../../publish.py
- name: create zip
working-directory: mower
run: zip -r mower.zip mower
- uses: actions/upload-artifact@v3
with:
name: mower
path: mower/mower.zip