-
-
Notifications
You must be signed in to change notification settings - Fork 3
148 lines (130 loc) · 4.7 KB
/
workflow.yml
File metadata and controls
148 lines (130 loc) · 4.7 KB
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
# Heavily inspired (i.e. copy/paste) from https://gist.github.com/NickNaso/0d478f1481686d5bcc868cac06620a60
name: CMake Build Matrix
# Controls when the action will run. Triggers the workflow on push
on:
pull_request:
release:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Windows Latest MSVC (C++17)",
os: windows-latest,
build_type: "Debug",
cc: "cl",
cxx: "cl",
environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Auxiliary/Build/vcvars64.bat",
generators: "Visual Studio 16 2019"
}
- {
name: "Ubuntu Latest GCC (C++17)",
os: ubuntu-latest,
build_type: "Debug",
cc: "gcc",
cxx: "g++",
generators: "Ninja"
}
- {
name: "macOS Latest Clang (C++17)",
os: macos-latest,
build_type: "Debug",
cc: "clang",
cxx: "clang++",
generators: "Xcode"
}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Print env
run: |
echo github.event.action: ${{ github.event.action }}
echo github.event_name: ${{ github.event_name }}
- name: Install dependencies on windows
if: startsWith(matrix.config.os, 'windows')
run: |
choco install ninja cmake
ninja --version
cmake --version
- name: Install dependencies on ubuntu
if: startsWith(matrix.config.name, 'Ubuntu Latest GCC')
run: |
sudo apt-get update
sudo apt-get install ninja-build cmake libtbb-dev g++ libgl1-mesa-dev libxmu-dev libfreetype6-dev libxi-dev libfontconfig1-dev
ninja --version
cmake --version
gcc --version
- name: Install dependencies on macos
if: startsWith(matrix.config.os, 'macos')
run: |
brew install cmake ninja tbb freetype
ninja --version
cmake --version
- name: Build Ubuntu
if: startsWith(matrix.config.name, 'Ubuntu')
shell: bash
run: |
bash ./build_occt.sh
make package
- name: Build MacOS
if: startsWith(matrix.config.name, 'macOS')
shell: bash
run: |
# SKIP for now !
# echo bash ./build_occt.sh
# echo make package
- name: Add msbuild to PATH
if: startsWith(matrix.config.name, 'Windows')
uses: microsoft/setup-msbuild@v1.1
- name: Build Windows
if: startsWith(matrix.config.name, 'Windows')
run: |
cmd /k build_occt.bat
- name: Deploy (Windows)
uses: actions/upload-artifact@v3
if: startsWith(matrix.config.name, 'Windows')
with:
name: artifact
path: dist/win64/*
- name: Deploy (Ubuntu)
uses: actions/upload-artifact@v3
if: startsWith(matrix.config.name, 'Ubuntu')
with:
name: artifact
path: dist/win64/occt-*
# - name: Create Release
# id: create_release
# if: startsWith(github.event.ref, 'refs/tags/v')
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ github.ref }}
# release_name: Release ${{ github.ref }}
# draft: false
# prerelease: false
- name: Upload Release Asset
id: upload-release-asset
if: startsWith(github.event.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
dist/**/*.tgz
dist/*.tgz
dist/win64/*.zip
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
# asset_path: dist/win64/
# asset_name: occt-${{github.ref_name}}${{runner.os}}.zip
# asset_content_type: application/zip