-
Notifications
You must be signed in to change notification settings - Fork 3
212 lines (197 loc) · 7 KB
/
cd.yaml
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
name: CD
on:
push:
branches:
- master
pull_request:
types:
- synchronize
- opened
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}
cancel-in-progress: true
jobs:
linux_64_executable:
name: Linux x64 Executable
if: github.event_name == 'push'
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OUTPUT: Bane-Of-Wargs-Linux
OUTPUT_DIST: Bane-Of-Wargs-Dist.zip
steps:
- name: Fix Checkout Problems
run: git config --global core.protectNTFS false
- uses: actions/checkout@v4
with:
show-progress: false
- name: Install Python & Pip
uses: actions/setup-python@v5
with:
python-version: '3.12.1'
cache: 'pip'
- name: Create Executable
run: |
git clone https://github.com/Dungeons-of-Kathallion/Bane-Of-Wargs.git
mkdir yamale
echo "4.0.4" >> yamale/VERSION
pip install -r requirements.txt
pip install PyInstaller
python -m PyInstaller Bane-Of-Wargs.spec
mv dist/Bane-Of-Wargs Bane-Of-Wargs-Linux
- name: Create Unpacked Compiled Program Zip
run: |
cd dist/
zip Bane-Of-Wargs-Dist.zip Bane-Of-Wargs-Other/**/**/**
cd ..
mv dist/Bane-Of-Wargs-Dist.zip Bane-Of-Wargs-Dist.zip
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.OUTPUT }}
path: ${{ env.OUTPUT }}
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.OUTPUT_DIST }}
path: ${{ env.OUTPUT_DIST }}
mac_64_executable:
name: MacOS x64 Executable
if: github.event_name == 'push'
runs-on: macos-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OUTPUT: Bane-Of-Wargs-Mac
steps:
- name: Fix Checkout Problems
run: git config --global core.protectNTFS false
- uses: actions/checkout@v4
with:
show-progress: false
- name: Install Python & Pip
uses: actions/setup-python@v5
with:
python-version: '3.12.1'
cache: 'pip'
- name: Create Executable
run: |
git clone https://github.com/Dungeons-of-Kathallion/Bane-Of-Wargs.git
mkdir yamale
echo "4.0.4" >> yamale/VERSION
pip install -r requirements.txt
pip install PyInstaller
python -m PyInstaller Bane-Of-Wargs.spec
mv dist/Bane-Of-Wargs Bane-Of-Wargs-Mac
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.OUTPUT }}
path: ${{ env.OUTPUT }}
windows_64_executable:
name: Windows x64 Executable
if: github.event_name == 'push'
runs-on: windows-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OUTPUT: Bane-Of-Wargs.exe
steps:
- name: Fix Checkout Problems
run: git config --global core.protectNTFS false
- uses: actions/checkout@v4
with:
show-progress: false
- name: Install Python & Pip
uses: actions/setup-python@v5
with:
python-version: '3.12.1'
cache: 'pip'
- name: Create Executable
run: |
git clone https://github.com/Dungeons-of-Kathallion/Bane-Of-Wargs.git
mkdir yamale
echo "4.0.4" >> yamale/VERSION
pip install -r requirements.txt
pip install windows-curses PyInstaller
python -m PyInstaller Bane-Of-Wargs.spec
mv dist/Bane-Of-Wargs.exe Bane-Of-Wargs.exe
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.OUTPUT }}
path: ${{ env.OUTPUT }}
cd_upload_artifacts_to_release:
name: Upload
if: github.event_name == 'push'
runs-on: ubuntu-latest
needs:
- linux_64_executable
- windows_64_executable
- mac_64_executable
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OUTPUT_LINUX: Bane-Of-Wargs-Linux
OUTPUT_WINDOWS: Bane-Of-Wargs.exe
OUTPUT_MAC: Bane-Of-Wargs-Mac
steps:
- uses: actions/checkout@v4
- name: Install github-release
run: |
go install github.com/github-release/github-release@latest
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Set environment variables
run: |
echo "GITHUB_USER=$( echo ${{ github.repository }} | cut -d/ -f1 )" >> $GITHUB_ENV
echo "GITHUB_REPO=$( echo ${{ github.repository }} | cut -d/ -f2 )" >> $GITHUB_ENV
- name: Move/Create continuous tag
run: |
git tag --force 9.9.9-continuous ${{ github.sha }}
git push --tags --force
- name: Setup continuous release
run: |
DESCRIPTION="This is an automated build triggered by commit ${{ github.sha }} (@${{ github.actor }}). It may be unstable or even crash, corrupt your save or eat your kitten. Use with caution!
This release was made to be compatible with the **3.12 python version** and the **latest release of the required python module**.
_Certain features will not work with earlier version of python._
_If you have an issues trying to install the game, please refer to the docs/PLAYING.md guide._
_Find a guide to build the game yourself at the docs/BUILDING.md document._"
if ! github-release info -t 9.9.9-continuous > /dev/null 2>&1; then
github-release release \
--tag 9.9.9-continuous \
--name "Continuous Build" \
--description "$DESCRIPTION" \
--pre-release
else
github-release edit \
--tag 9.9.9-continuous \
--name "Continuous Build" \
--description "$DESCRIPTION" \
--pre-release
fi
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
path: ${{ github.workspace }}
- name: Add ${{ env.OUTPUT_LINUX }} to release tag
continue-on-error: true
run: |
github-release upload \
--tag 9.9.9-continuous \
--replace \
--name ${{ env.OUTPUT_LINUX }} \
--file ${{ env.OUTPUT_LINUX }}/${{ env.OUTPUT_LINUX }}
- name: Add ${{ env.OUTPUT_MAC }} to release tag
continue-on-error: true
run: |
github-release upload \
--tag 9.9.9-continuous \
--replace \
--name ${{ env.OUTPUT_MAC }} \
--file ${{ env.OUTPUT_MAC }}/${{ env.OUTPUT_MAC }}
- name: Add ${{ env.OUTPUT_WINDOWS }} to release tag
continue-on-error: true
run: |
github-release upload \
--tag 9.9.9-continuous \
--replace \
--name ${{ env.OUTPUT_WINDOWS }} \
--file ${{ env.OUTPUT_WINDOWS }}/${{ env.OUTPUT_WINDOWS }}