-
Notifications
You must be signed in to change notification settings - Fork 3
115 lines (91 loc) · 2.88 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
name: Build Binaries
defaults:
run:
shell: bash
on:
workflow_dispatch
jobs:
create_release:
name: Create Release
if: contains('["raub"]', github.actor)
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Fetch Repository
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18.16.0
cache: 'npm'
- name: Get Package Version
id: package-version
run: node -p "'version='+require('./package').version" >> $GITHUB_OUTPUT
- name: Create Draft Release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
tag_name: ${{ steps.package-version.outputs.version }}
name: Release ${{ steps.package-version.outputs.version }}
body: Binaries at ${{ github.sha }}
build:
name: Build
strategy:
matrix:
os: [ubuntu-20.04, windows-2022, macos-11, [self-hosted, linux, ARM64]]
runs-on: ${{ matrix.os }}
steps:
- name: Fetch Repository
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18.16.0
cache: 'npm'
- name: Install Modules
run: npm ci --ignore-scripts
- name: Add msbuild to PATH
if: matrix.os == 'windows-2022'
uses: microsoft/[email protected]
with:
msbuild-architecture: x64
- name: Build Pre Step
run: chmod +x src/extract.sh && src/extract.sh
- name: Build Unix
if: matrix.os != 'windows-2022'
run: node src/build-unix
- name: LS Unix 1
if: matrix.os != 'windows-2022'
run: ls src/bullet3
- name: LS Unix 2
if: matrix.os != 'windows-2022'
run: ls src/bullet3/build/src
- name: Build Windows
if: matrix.os == 'windows-2022'
run: src/windows.sh
- name: Build Post Step
run: node src/build-post
- name: Get Package Version
id: package-version
shell: bash
run: node -p "'version='+require('./package').version" >> $GITHUB_OUTPUT
- name: Pack Files
id: pack-files
run: node -e "require('addon-tools-raub').actionPack()" >> $GITHUB_OUTPUT
- name: Store Binaries
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
tag_name: ${{ steps.package-version.outputs.version }}
name: Release ${{ steps.package-version.outputs.version }}
files: ${{ steps.pack-files.outputs.pack }}