-
Notifications
You must be signed in to change notification settings - Fork 0
166 lines (148 loc) · 6.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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: ExamplePlugins
on:
push:
pull_request:
workflow_dispatch:
inputs:
forceMacBuild:
description: 'If set true override the ENABLE_MACOS_BUILD to force a build'
type: boolean
default: false
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
MACENABLED: ${{ inputs.forceMacBuild }}
USERNAME: ManiVaultStudio
FEED_URL: https://nuget.pkg.github.com/ManiVaultStudio/index.json
VCPKG_BINARY_SOURCES: "clear;nuget,https://nuget.pkg.github.com/ManiVaultStudio/index.json,readwrite"
# for matrix check https://docs.github.com/en/actions/reference/specifications-for-github-hosted-runners
jobs:
prepare_matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.matrix_setup.outputs.matrix }}
steps:
- name: Get matrix from file
id: matrix_setup
uses: ManiVaultStudio/github-actions/matrix_setup@main
cross-platform-build:
name: Cross platform build
needs: prepare_matrix
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ${{ matrix.os }}
strategy:
matrix:
include: ${{ fromJson(needs.prepare_matrix.outputs.matrix) }}
steps:
- name: Checkout the source
if: github.event_name != 'pull_request'
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Checkout the source - pull request
if: github.event_name == 'pull_request'
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
- name: Select Xcode for Mac only
if: startsWith(runner.os, 'macOS')
run: |
sudo xcode-select -switch /Applications/Xcode_${{matrix.build-xcode-version}}.app
- name: Setup python version
uses: actions/setup-python@v1
with:
python-version: "3.11"
- name: Start ssh key agent
uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.RULESSUPPORT_DEPLOY_KEY }}
- name: Install SSH deploy key for rulessupport
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.RULESSUPPORT_DEPLOY_KEY }}
known_hosts: github.com AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==
# Install vcpkg
- name: Install vcpkg
if: startsWith(matrix.os, 'windows')
shell: pwsh
run: ${{github.workspace}}/vcpkg/bootstrap-vcpkg.bat
- name: Install vcpkg
if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macos')
shell: bash
run: |
echo "Subfolders of ${{github.workspace}}:"
ls -R ${{github.workspace}} | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\// /g' -e 's/^/ /' -e 's/-/|/'
${{github.workspace}}/vcpkg/bootstrap-vcpkg.sh
# Add NuGet sources
- name: Add NuGet sources
if: startsWith(matrix.os, 'windows')
shell: pwsh
run: |
.$(${{github.workspace}}/vcpkg/vcpkg.exe fetch nuget) `
sources add `
-Source "${{ env.FEED_URL }}" `
-StorePasswordInClearText `
-Name GitHubPackages `
-UserName "${{ env.USERNAME }}" `
-Password "${{ secrets.GH_PACKAGES_TOKEN }}"
.$($${{github.workspace}}/vcpkg/vcpkg.exe fetch nuget) `
setapikey "${{ secrets.GH_PACKAGES_TOKEN }}" `
-Source "${{ env.FEED_URL }}"
- name: Add NuGet sources
if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macos')
shell: bash
run: |
.$($${{github.workspace}}/vcpkg/vcpkg fetch nuget) `
sources add `
-Source "${{ env.FEED_URL }}" `
-StorePasswordInClearText `
-Name GitHubPackages `
-UserName "${{ env.USERNAME }}" `
-Password "${{ secrets.GH_PACKAGES_TOKEN }}"
.$($${{github.workspace}}/vcpkg/vcpkg fetch nuget) `
setapikey "${{ secrets.GH_PACKAGES_TOKEN }}" `
-Source "${{ env.FEED_URL }}"
# Build the package
- name: Windows build
if: startsWith(matrix.os, 'windows')
uses: ManiVaultStudio/github-actions/conan_windows_build@main
with:
conan-visual-version: ${{matrix.build-cversion}}
conan-visual-runtime: ${{matrix.build-runtime}}
conan-build-type: ${{matrix.build-config}}
conan-user: ${{secrets.LKEB_UPLOAD_USER}}
conan-password: ${{secrets.LKEB_UPLOAD_USER_PASSWORD}}
conan-pem: ${{secrets.LKEB_UPLOAD_CERT_CHAIN}}
rs_ssh_key: ${{ secrets.RULESSUPPORT_DEPLOY_KEY }}
- name: Linux build
if: startsWith(matrix.os, 'ubuntu')
uses: ManiVaultStudio/github-actions/conan_linuxmac_build@main
with:
conan-compiler: ${{matrix.build-compiler}}
conan-compiler-version: ${{matrix.build-cversion}}
conan-libcxx-version: ${{matrix.build-libcxx}}
conan-build-type: ${{matrix.build-config}}
conan-build-os: ${{matrix.build-os}}
conan-user: ${{secrets.LKEB_UPLOAD_USER}}
conan-password: ${{secrets.LKEB_UPLOAD_USER_PASSWORD}}
conan-pem: ${{secrets.LKEB_UPLOAD_CERT_CHAIN}}
conan-cc: gcc-${{matrix.build-cversion}}
conan-cxx: g++-${{matrix.build-cversion}}
- name: Mac build
if: startsWith(matrix.os, 'macos') && (env.MACENABLED == 'true' || vars.ENABLE_MACOS_BUILD == 'True')
uses: ManiVaultStudio/github-actions/conan_linuxmac_build@main
with:
conan-compiler: ${{matrix.build-compiler}}
conan-compiler-version: ${{matrix.build-cversion}}
conan-libcxx-version: ${{matrix.build-libcxx}}
conan-build-type: ${{matrix.build-config}}
conan-build-os: ${{matrix.build-os}}
conan-user: ${{secrets.LKEB_UPLOAD_USER}}
conan-password: ${{secrets.LKEB_UPLOAD_USER_PASSWORD}}
conan-pem: ${{secrets.LKEB_UPLOAD_CERT_CHAIN}}