-
Notifications
You must be signed in to change notification settings - Fork 1
115 lines (102 loc) · 4.04 KB
/
build_on_push.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
# Workflow to automatically compile a Linux/Windows library on commit/push
name: Build on push
# Controls when the action will run. Triggers the workflow on push or pull request
# events, but only for the master branch we'll create .zip files
on:
[push, pull_request]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This job builds the plugin for our target platforms
build:
name: Building for ${{ matrix.platform }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
include:
# faster testing by disabling the others...
- os: macos-latest
platform: macos
- os: windows-latest
platform: windows
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Add msbuild to PATH (Windows)
uses: microsoft/setup-msbuild@v1.1
with:
msbuild-architecture: x64
if: matrix.platform == 'windows'
- name: Get SDK (MacOS)
run: |
omnis_sdk=$(curl -s "https://filestore.omnis.net/omnisrestservlet/ws/5975/api/file_browser/browser/file?file=/OmnisStudio/Studio1100_36251/SDK/macOS-SDK-11-36251.dmg&browsertype=0&odppid=blank" | awk {'print $1'})
curl -O "$omnis_sdk"
hdiutil attach macOS-SDK-11-36251.dmg
cp -a /volumes/macOS-SDK-11-36251/macOS_SDK_11_36251/. thirdparty/omnis.sdk/mac/
hdiutil detach /volumes/macOS-SDK-11-36251
if: matrix.platform == 'macos'
- name: Get SDK (Windows)
run: |
$response = Invoke-WebRequest -uri "https://filestore.omnis.net/omnisrestservlet/ws/5975/api/file_browser/browser/file?file=/OmnisStudio/Studio1100_36251/SDK/Windows-SDK-11-36251-x64.zip&browsertype=0&odppid=blank"
$omnissdk = [System.Text.Encoding]::UTF8.GetString($response.content)
Invoke-WebRequest -uri $omnissdk -OutFile WindowsSDK.zip
mkdir WindowsSDK
cd WindowsSDK
tar -xf ../WindowsSDK.zip
cd ..
xcopy /E /I WindowsSDK\* thirdparty\omnis.sdk\win\
if: matrix.platform == 'windows'
- name: Build (MacOS)
run: |
xcodebuild -project oWidget.xcodeproj build
if: matrix.platform == 'macos'
- name: Build (Windows)
run: |
MSBuild oWidget.vcxproj /property:Platform=x64 /property:Configuration="Release"
if: matrix.platform == 'windows'
- name: Upload build files (artifacts) (MacOS)
uses: actions/upload-artifact@v4
with:
name: xcomp-macos
path: |
build/release
if: matrix.platform == 'macos'
- name: Upload build files (artifacts) (Windows)
uses: actions/upload-artifact@v4
with:
name: xcomp-windows
path: |
build/Release_x64/xcomp/oWidget.dll
if: matrix.platform == 'windows'
# This job collects the build output and assembles the final asset (artifact)
asset:
name: Assembling the asset (artifact)
runs-on: ubuntu-20.04
needs: build
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Download all workflow run artifacts
uses: actions/download-artifact@v4
- name: Copy files to destination
run: |
mkdir oWidget
mkdir oWidget/macos
mkdir oWidget/windows
cp -a xcomp-macos/. oWidget/macos/
cp xcomp-windows/oWidget.dll oWidget/windows/
- name: Get tag name
run: |
echo "GITHUB_SHA_SHORT=$(echo ${GITHUB_REF##*/})" >> $GITHUB_ENV
if: startsWith(github.ref, 'refs/tags')
- name: Zip asset
run: |
zip -qq -r oWidget.zip oWidget/.
- name: Create and upload asset
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: "oWidget.zip"
token: ${{ secrets.GITHUB_TOKEN }}