-
-
Notifications
You must be signed in to change notification settings - Fork 15
63 lines (51 loc) · 2.27 KB
/
daily-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
name: Daily build
on:
schedule:
- cron: 0 0 * * * # Every day at midnight (UTC)
workflow_dispatch:
jobs:
daily-build:
runs-on: windows-latest
strategy:
matrix:
rid: [linux_x64, win_x64, osx_x64]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
global-json-file: global.json
- name: Restore
run: ./build.cmd Restore
- name: Build
run: ./build.cmd Publish --runtime ${{matrix.rid}} --skip Restore
- if: ${{ matrix.rid == 'linux_x64' }}
name: Download libOpenCvSharpExtern.so
shell: pwsh
env:
GH_TOKEN: ${{ github.token }}
run: |
$TFM = dotnet msbuild --getProperty:TargetFramework src/Beutl/Beutl.csproj
$Packages = dotnet list src/Beutl.Engine/Beutl.Engine.csproj package --framework $TFM --format json
#4.9.0.2024
$OpenCvSharpVersion = (echo $Packages | jq -r '.projects[0].frameworks[0].topLevelPackages | map(select(.id == "OpenCvSharp4"))[0].requestedVersion')
#4.9.0
$OpenCvVersion = [System.String]::Join('.', [System.Linq.Enumerable]::Take($OpenCvSharpVersion.Split('.'), 3))
#GitのタグとNuGetのバージョンが違う場合があるので
$Filter = 'map(select(.tag_name | startswith("'+$OpenCvVersion+'")))[0].tag_name'
$OpenCvSharpTag = (gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/shimat/opencvsharp/releases | jq $Filter)
#ダウンロード
$Release = (gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/indigo-san/opencvsharp-extern-builds/releases/tags/$OpenCvSharpTag)
$AssetId = (echo $Release | jq '.assets | map(select(.name == "libOpenCvSharpExtern.so")).id')
cd output/Beutl
gh api -H "Accept: application/octet-stream" -H "X-GitHub-Api-Version: 2022-11-28" /repos/indigo-san/opencvsharp-extern-builds/releases/assets/$AssetId > libOpenCvSharpExtern.so
- name: Zip
run: ./build.cmd Zip --runtime ${{matrix.rid}} --skip Publish
- name: Save
uses: actions/upload-artifact@v3
with:
name: beutl_${{matrix.rid}}
path: ./artifacts/