-
-
Notifications
You must be signed in to change notification settings - Fork 6
169 lines (165 loc) · 5.5 KB
/
package-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
name: package build
on:
push:
branches:
- master
tags:
- v*
pull_request:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-linux:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: build linux outputs
run: |
sudo apt-get -y update
sudo apt-get -y install build-essential \
libclang-12-dev \
llvm-12 \
cmake \
mesa-common-dev \
libgl1-mesa-dev \
curl
sudo apt remove llvm-10 clang-10
make
echo UPLOAD_FILE=cutter-deps-linux-x86_64.tar.gz >> $GITHUB_ENV
echo UPLOAD_ASSET_TYPE=application/gzip >> $GITHUB_ENV
- uses: actions/upload-artifact@v2
with:
name: ${{ env.UPLOAD_FILE }}
path: ${{ env.UPLOAD_FILE }}
- name: Get release
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
id: get_release
uses: karliss/get-release@bee343636450eb2e9b85d9f1592d8d73c408dc74
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload release assets
if: steps.get_release.outputs.upload_url != null
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ${{ env.UPLOAD_FILE }}
asset_name: ${{ env.UPLOAD_FILE }}
asset_content_type: ${{ env.UPLOAD_ASSET_TYPE }}
build-windows:
runs-on: windows-2019
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: build windows ouptuts
shell: cmd
run: |
pwd
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
where cl
where python
set MSYS2_PATH_TYPE=inherit
C:/shells/msys2bash.cmd "./scripts/build_win.sh"
- name: set windows outputs
shell: bash
run: |
echo UPLOAD_FILE=cutter-deps-win-x86_64.tar.gz >> $GITHUB_ENV
echo UPLOAD_ASSET_TYPE=application/gzip >> $GITHUB_ENV
- uses: actions/upload-artifact@v2
with:
name: ${{ env.UPLOAD_FILE }}
path: ${{ env.UPLOAD_FILE }}
- name: Get release
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
id: get_release
uses: karliss/get-release@bee343636450eb2e9b85d9f1592d8d73c408dc74
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload release assets
if: steps.get_release.outputs.upload_url != null
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ${{ env.UPLOAD_FILE }}
asset_name: ${{ env.UPLOAD_FILE }}
asset_content_type: ${{ env.UPLOAD_ASSET_TYPE }}
build-macos:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
name: [
macos-x86_64,
macos-arm64,
]
include:
- name: macos-x86_64
os: macos-12
arch: x86_64
- name: macos-arm64
os: macos-14
arch: arm64
steps:
- uses: actions/checkout@v3
- name: build macos
run: |
set -euo pipefail
brew install llvm ccache
if [ "${{ matrix.arch }}" = "arm64" ]; then
export CMAKE_PREFIX_PATH="$HOMEBREW_PREFIX/opt/llvm";
else
export CMAKE_PREFIX_PATH="/usr/local/opt/llvm";
fi
echo "###### Applications ######"
ls /Applications
echo "###### XCode Info ######"
sudo xcode-select --reset
export BUILD_SDK_PATH=$(xcrun --show-sdk-path)
echo "$BUILD_SDK_PATH"
echo "###### xcode-select Info ######"
xcode-select -print-path
echo "###### LLVM Info ######"
which clang
brew info llvm
echo "###### Make ######"
export MACOSX_DEPLOYMENT_TARGET=11.0
export MIN_SUPPORTED_MACOSX_DEPLOYMENT_TARGET=11.0
export CFLAGS=" -isysroot $BUILD_SDK_PATH "
export CCFLAGS=" -isysroot $BUILD_SDK_PATH "
export CXXFLAGS=" -isysroot $BUILD_SDK_PATH "
make
echo UPLOAD_FILE=cutter-deps-macos-${{ matrix.arch }}.tar.gz >> $GITHUB_ENV
echo UPLOAD_ASSET_TYPE=application/gzip >> $GITHUB_ENV
- uses: actions/upload-artifact@v2
with:
name: ${{ env.UPLOAD_FILE }}
path: ${{ env.UPLOAD_FILE }}
- name: Get release
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
id: get_release
uses: karliss/get-release@bee343636450eb2e9b85d9f1592d8d73c408dc74
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload release assets
if: steps.get_release.outputs.upload_url != null
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ${{ env.UPLOAD_FILE }}
asset_name: ${{ env.UPLOAD_FILE }}
asset_content_type: ${{ env.UPLOAD_ASSET_TYPE }}