-
Notifications
You must be signed in to change notification settings - Fork 1
186 lines (157 loc) · 5.48 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
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
name: Wails build
on:
push:
branches:
- main
tags:
- "*"
pull_request:
branches:
- main
workflow_dispatch:
env:
NODE_OPTIONS: "--max-old-space-size=4096"
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Set outputs
id: vars
run: |
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
echo "version=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT
else
echo "version=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
fi
shell: bash
# Setup and configure GoLang
- name: Setup GoLang
uses: actions/setup-go@v4
with:
check-latest: true
go-version: 1.23.1
- run: go version
shell: bash
# Setup and configure NodeJS
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: v23.4.0
# install wails
- name: Install Wails
run: go install github.com/wailsapp/wails/v2/cmd/[email protected]
shell: bash
- name: Install UPX
if: runner.os == 'Windows'
uses: crazy-max/ghaction-upx@v3
with:
install-only: true
- name: Install Linux Wails deps
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install libgtk-3-0 libwebkit2gtk-4.1-dev gcc-aarch64-linux-gnu
shell: bash
- name: Build App Linux
if: runner.os == 'Linux'
run: wails build --platform 'linux' -o blunderDB-linux-${{ steps.vars.outputs.version }} -upx -clean -tags webkit2_41
shell: bash
- name: Build App Windows
if: runner.os == 'Windows'
run: wails build --platform 'windows' -o blunderDB-windows-${{ steps.vars.outputs.version }}.exe -upx -clean -tags webkit2_41
shell: bash
- name: Build App MacOS
if: runner.os == 'macOS'
run: wails build --platform 'darwin/universal' -o blunderDB-macos-${{ steps.vars.outputs.version }} -clean -tags webkit2_41
shell: bash
- name: Add Linux perms
if: runner.os == 'Linux'
run: chmod +x build/bin/*
shell: bash
- name: Add macOS perms
if: runner.os == 'macOS'
run: |
chmod +x build/bin/*/Contents/MacOS/*
mv build/bin/blunderDB.app build/bin/blunderDB-macos-${{ steps.vars.outputs.version }}.app
zip -r build/bin/blunderDB-macos-${{ steps.vars.outputs.version }}.zip build/bin/blunderDB-macos-${{ steps.vars.outputs.version }}.app
shell: bash
# - name: Build .app zip file
# if: runner.os == 'macOS'
# shell: bash
# run: |
# ditto -c -k --keepParent ./build/bin/blunderdb.app ./build/bin/blunderDB-macos-${{ steps.vars.outputs.version }}.app.zip
# Upload build assets
- uses: actions/upload-artifact@v4
with:
name: Wails Build ${{runner.os}} blunderDB ${{ steps.vars.outputs.version }}
path: |
*/bin/
*\bin\*
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
*/bin/*
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Set outputs
id: vars
run: |
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
echo "version=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT
else
echo "version=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
fi
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r ./doc/requirements.txt
sudo apt-get update && sudo apt-get install latexmk texlive-xetex texlive-fonts-recommended texlive-latex-extra
shell: bash
- name: Build documentation
run: |
cd ./doc
python build.py
- name: Rename PDF files
run: |
find ./doc/build/pdf_en/ -name '*.pdf' -exec mv {} ./doc/build/pdf_en/blunderDB-${{ steps.vars.outputs.version }}-en.pdf \;
find ./doc/build/pdf_fr/ -name '*.pdf' -exec mv {} ./doc/build/pdf_fr/blunderDB-${{ steps.vars.outputs.version }}-fr.pdf \;
shell: bash
- name: Create index.html for redirection
run: |
echo '<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0; url=en/"></head><body></body></html>' > ./doc/build/index.html
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./doc/build
publish_branch: gh-pages
keep_files: false # This will clean the branch before deploying
# Upload build assets
- uses: actions/upload-artifact@v4
with:
name: blunderDB pdf docs
path: |
*/build/pdf_en/*.pdf
*/build/pdf_fr/*.pdf
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
*/build/pdf_en/*.pdf
*/build/pdf_fr/*.pdf