-
Notifications
You must be signed in to change notification settings - Fork 7
151 lines (139 loc) · 4.55 KB
/
build.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
name: build brickrail
on: [push]
env:
GODOT_VERSION: 3.5
EXPORT_NAME: Brickrail
PROJECT_PATH: brickrail-gui
jobs:
ble-server-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10}
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: run pyinstaller
run: |
pyinstaller ble_server-linux.spec
- name: upload dist
uses: actions/upload-artifact@v3
with:
name: ble-server-linux
path: dist/ble-server-linux
retention-days: 1
ble-server-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: run pyinstaller
run: |
pyinstaller ble_server-windows.spec
- name: upload dist
uses: actions/upload-artifact@v3
with:
name: ble-server-windows
path: dist/ble-server-windows
retention-days: 1
build-app:
name: Build godot app and package with ble server
needs: [ble-server-windows, ble-server-linux]
runs-on: ubuntu-latest
container:
image: barichello/godot-ci:3.5
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
run: |
mkdir -v -p ~/.local/share/godot/templates
mv /root/.local/share/godot/templates/${GODOT_VERSION}.stable ~/.local/share/godot/templates/${GODOT_VERSION}.stable
- name: Windows Build
run: |
mkdir -v -p build/windows
cd $PROJECT_PATH
godot -v --export-debug "Windows Desktop" ../build/windows/$EXPORT_NAME.exe
- name: Linux Build
run: |
mkdir -v -p build/linux
cd $PROJECT_PATH
godot -v --export-debug "Linux/X11" ../build/linux/$EXPORT_NAME.x86_64
- name: Download windows ble-server artifact
uses: actions/download-artifact@v3
with:
name: ble-server-windows
path: build/windows/ble-server-windows
- name: Download linux ble-server artifact
uses: actions/download-artifact@v3
with:
name: ble-server-linux
path: build/linux/ble-server-linux
- name: Copy firmware and LICENSE into build folders
run: |
mkdir -v -p build/windows/firmware
cp firmware/* build/windows/firmware
cp LICENSE build/windows/LICENSE
mkdir -v -p build/linux/firmware
cp firmware/* build/linux/firmware
cp LICENSE build/linux/LICENSE
- name: Append commit sha to version file
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: echo -$(echo ${{ github.sha }} | cut -c1-8) >> version.txt
- name: Add version file
run: |
cp version.txt build/linux/
cp version.txt build/windows/
- name: Upload windows Artifact
uses: actions/upload-artifact@v1
with:
name: brickrail-windows
path: build/windows
- name: Upload linux Artifact
uses: actions/upload-artifact@v1
with:
name: brickrail-linux
path: build/linux
release:
name: Upload release
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: [build-app]
steps:
- name: Download windows build
uses: actions/download-artifact@v3
with:
name: brickrail-windows
path: brickrail-windows
- name: Download linux build
uses: actions/download-artifact@v3
with:
name: brickrail-linux
path: brickrail-linux
- name: Get tag
run: echo "GITHUB_TAG=${GITHUB_REF#*refs/tags/}" >> $GITHUB_ENV
- name: add linux executable permission
run: chmod +x brickrail-linux/Brickrail.x86_64
- name: zip builds
run: |
zip -r brickrail-windows-${{ env.GITHUB_TAG }}.zip brickrail-windows
zip -r brickrail-linux-${{ env.GITHUB_TAG }}.zip brickrail-linux
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
brickrail-windows-${{ env.GITHUB_TAG }}.zip
brickrail-linux-${{ env.GITHUB_TAG }}.zip