-
-
Notifications
You must be signed in to change notification settings - Fork 5
160 lines (160 loc) · 7.23 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
name: Build
on: [push, workflow_dispatch, pull_request]
jobs:
macos:
runs-on: macOS-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Notify Gitlab Start
env:
GITLAB_ACCESS_TOKEN: ${{ secrets.GITLAB_ACCESS_TOKEN }}
run: |
pip3 install requests
./deploy/gitlab_commit_status.py running
- name: Install Deps
run: |
brew install coreutils ed findutils gawk gnu-sed gnu-tar grep make
export PATH="$(echo /usr/local/opt/*/libexec/gnubin | tr ' ' :):$PATH"
./deploy/mac_build.sh deps
- name: Build
env:
API_KEY_GOOGLE_FONTS: ${{ secrets.API_KEY_GOOGLE_FONTS }}
run: |
export PATH="$(echo /usr/local/opt/*/libexec/gnubin | tr ' ' :):$PATH"
./deploy/mac_build.sh configure "mac-${GITHUB_SHA:0:8}"
./deploy/mac_build.sh build
cp build/checksum.txt build/checksum-mac.txt
- name: Build Python
if: false
run: |
cd build
CI_COMMIT_BRANCH="${GITHUB_REF#refs/*/}"
CI_COMMIT_SHORT_SHA="${GITHUB_SHA:0:8}"
cmake .. -DVERSION_SUFFIX="git.`date +%Y%m%d%H%M%S`.$CI_COMMIT_BRANCH.$CI_COMMIT_SHORT_SHA"
cd ..
export PATH="$(echo /usr/local/opt/*/libexec/gnubin | tr ' ' :):$PATH"
./deploy/mac_build.sh pypi
# Artifacts are always zipped, even if you only have 1 file... Just adding them so it's easier to verify them
- name: Job Artifacts
uses: actions/upload-artifact@v2
with:
name: glaxnimate-mac
path: |
build/checksum.txt
build/glaxnimate.dmg
build/bin/python/dist/
- name: Update Release
uses: johnwbyrd/[email protected]
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/pre-release' || github.ref == 'refs/heads/release' || startsWith(github.ref, 'refs/tags/') }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: ./build/checksum-mac.txt ./build/glaxnimate.dmg
- name: Upload Artifacts
if: false # ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/pre-release' || github.ref == 'refs/heads/release' }}
env:
SSH_PRIV_KEY: ${{ secrets.SSH_PRIV_KEY }}
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
run: |
echo "$SSH_PRIV_KEY" >privkey
chmod 600 privkey
branch="${GITHUB_REF#refs/*/}"
export PATH="$(echo /usr/local/opt/*/libexec/gnubin | tr ' ' :):$PATH"
./deploy/mac_build.sh deploy "$branch" "-i $PWD/privkey"
- name: Upload Pypi
if: false
env:
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD_GITLAB }}
TWINE_USERNAME: __token__
run: |
python3 -m twine upload build/bin/python/dist/*.whl --repository-url https://gitlab.com/api/v4/projects/19921167/packages/pypi --verbose
- name: Notify Gitlab Finish
if: ${{ always() }}
env:
GITLAB_ACCESS_TOKEN: ${{ secrets.GITLAB_ACCESS_TOKEN }}
RESULT: ${{ job.status }}
run: |
./deploy/gitlab_commit_status.py $RESULT
windows:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- name: Setup msys2
uses: msys2/setup-msys2@v2
with:
path-type: strict
update: true
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Notify Gitlab Start
env:
GITLAB_ACCESS_TOKEN: ${{ secrets.GITLAB_ACCESS_TOKEN }}
run: |
pacman --noconfirm -S mingw-w64-x86_64-python-pip
pip install requests
./deploy/gitlab_commit_status.py running
- name: Install Deps
run: |
./deploy/win_build.sh deps
- name: Build
env:
API_KEY_GOOGLE_FONTS: ${{ secrets.API_KEY_GOOGLE_FONTS }}
run: |
(cd ./data/icons/breeze-icons/ && git config core.symlinks true && git reset --hard &>/dev/null)
./deploy/win_build.sh configure "win-${GITHUB_SHA:0:8}"
./deploy/win_build.sh build
cp build/checksum.txt build/checksum-win.txt
- name: Build Python
if: false
run: |
cd build
CI_COMMIT_BRANCH="${GITHUB_REF#refs/*/}"
CI_COMMIT_SHORT_SHA="${GITHUB_SHA:0:8}"
cmake .. -DVERSION_SUFFIX="git.`date +%Y%m%d%H%M%S`.$CI_COMMIT_BRANCH.$CI_COMMIT_SHORT_SHA"
cd ..
./deploy/win_build.sh pypi
# Artifacts are always zipped, even if you only have 1 file... Just adding them so it's easier to verify them
- name: Job Artifacts
uses: actions/upload-artifact@v2
with:
name: glaxnimate-win
path: |
build/checksum.txt
build/glaxnimate-x86_64.zip
build/bin/python/dist/
- name: Update Release
uses: johnwbyrd/[email protected]
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/pre-release' || github.ref == 'refs/heads/release' || startsWith(github.ref, 'refs/tags/') }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: ./build/checksum-win.txt ./build/glaxnimate-x86_64.zip
- name: Upload Artifacts
if: false # ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/pre-release' || github.ref == 'refs/heads/release' }}
env:
SSH_PRIV_KEY: ${{ secrets.SSH_PRIV_KEY }}
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
run: |
echo "$SSH_PRIV_KEY" >privkey
chmod 600 privkey
branch="${GITHUB_REF#refs/*/}"
./deploy/win_build.sh deploy "$branch" "-i $PWD/privkey"
- name: Upload Pypi
if: false
env:
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD_GITLAB }}
TWINE_USERNAME: __token__
run: |
python3 -m twine upload build/bin/python/dist/*.whl --repository-url https://gitlab.com/api/v4/projects/19921167/packages/pypi --verbose
- name: Notify Gitlab Finish
if: ${{ always() }}
env:
GITLAB_ACCESS_TOKEN: ${{ secrets.GITLAB_ACCESS_TOKEN }}
RESULT: ${{ job.status }}
run: |
./deploy/gitlab_commit_status.py $RESULT