-
Notifications
You must be signed in to change notification settings - Fork 0
139 lines (119 loc) · 4.4 KB
/
build-master.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
# Buid BulletSim binaries from the latest Bullet and BulletSim glue sources
name: BulletSim Linux binaries
on:
push:
branches:
- master
jobs:
build:
strategy:
matrix:
# os: [ ubuntu-latest, macos-latest, windows-latest ]
include:
- os: ubuntu-20.04
osclass: ubuntu
name: "BulletSim binary build for Ubuntu"
build_type: Release
ext: so
scriptext: sh
- os: macos-12
osclass: macos
name: "BulletSim binary build for MacOS"
build_type: Release
ext: dylib
scriptext: sh
- os: windows-latest
osclass: win
name: "BulletSim binary build for Windows"
build_type: Release
ext: dll
scriptext: ps1
runs-on: ${{ matrix.os }}
name: ${{ matrix.name }}
steps:
- name: git checkout
uses: actions/checkout@v3
with:
ref: master
path: bulletsim
- name: checkout Bullet
uses: actions/checkout@v3
with:
repository: bulletphysics/bullet3
path: bulletsim/bullet3
- name: apply patches to Bullet
shell: bash
run: |
cd bulletsim/bullet3
for file in ../00*.patch ; do echo "====== $file" ; git apply $file ; done
- name: set env vars based on sources
shell: bash
run: |
echo "BuildDate=$(date +%Y%m%d)" >> $GITHUB_ENV
cd bulletsim
echo "BulletSimVersion=$(cat VERSION)" >> $GITHUB_ENV
echo "BulletSimGitVersion=$(git rev-parse HEAD)" >> $GITHUB_ENV
echo "BulletSimGitVersionShort=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
cd bullet3
echo "BulletVersion=$(cat VERSION)" >> $GITHUB_ENV
echo "BulletGitVersion=$(git rev-parse HEAD)" >> $GITHUB_ENV
echo "BulletGitVersionShort=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: create BulletSimVersionInfo file
shell: bash
run: |
cd bulletsim
echo "BuildDate=$BuildDate" > BulletSimVersionInfo
echo "BulletSimVersion=$BulletSimVersion" >> BulletSimVersionInfo
echo "BulletSimGitVersion=$BulletSimGitVersion" >> BulletSimVersionInfo
echo "BulletSimGitVersionShort=$BulletSimGitVersionShort" >> BulletSimVersionInfo
echo "BulletVersion=$BulletVersion" >> BulletSimVersionInfo
echo "BulletGitVersion=$BulletGitVersion" >> BulletSimVersionInfo
echo "BulletGitVersionShort=$BulletGitVersionShort" >> BulletSimVersionInfo
# Add CMake for Windows build
- name: install CMake
if: matrix.osclass == 'win'
uses: jwlawson/actions-setup-cmake@v1.13
# Add Dotnet for Windows build
- name: Setup Dotnet
if: matrix.osclass == 'win'
uses: actions/setup-dotnet@v2
with:
dotnet-version: '6.0.x'
# Add MSVC libraries for Windows build
- name: Setup MSVC
if: matrix.osclass == 'win'
uses: microsoft/setup-msbuild@v1.3.1
- name: build Bullet physics engine
run: |
cd bulletsim
./buildBulletCMake.${{ matrix.scriptext }}
- name: build BulletSim
run: |
cd bulletsim
./buildBulletSim.${{ matrix.scriptext }}
# Dotnet build puts binaries in sub-dirs so move them to a standard place
- name: move dotnet built files into 'built' directory
if: matrix.osclass == 'win'
shell: bash
run: |
mkdir built
cp bulletsim/BulletSimVersionInfo built/
cp bulletsim/x64/${{ matrix.build_type }}/BulletSim.dll built/
cp bulletsim/x64/${{ matrix.build_type }}/BulletSim.lib built/
cp bulletsim/x64/${{ matrix.build_type }}/BulletSim.pdb built/
# Other targets just build the binaries
- name: move non-dotnet built files into 'built' directory
if: matrix.osclass != 'win'
shell: bash
run: |
mkdir built
cp bulletsim/BulletSimVersionInfo built/
cp bulletsim/*.${{ matrix.ext }} built/
- name: Upload built files
if: success()
uses: actions/upload-artifact@v3
with:
name: BulletSim-${{ matrix.osclass }}-${{ env.BuildDate }}
path: built/*
if-no-files-found: error
# vim: tabstop=2 shiftwidth=2 autoindent expandtab