-
-
Notifications
You must be signed in to change notification settings - Fork 15
91 lines (77 loc) · 3.08 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
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
name: Daily build
on:
schedule:
- cron: 0 0 * * * # Every day at midnight (UTC)
workflow_dispatch:
jobs:
determine-version:
runs-on: ubuntu-latest
outputs:
nugetVer: ${{ steps.nbgv.outputs.NuGetPackageVersion }}
asmVer: ${{ steps.nbgv.outputs.AssemblyFileVersion }}
infoVer: ${{ steps.nbgv.outputs.AssemblyInformationalVersion }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Nerdbank.GitVersioning
id: nbgv
uses: dotnet/[email protected]
daily-build:
needs: [determine-version]
runs-on: ubuntu-latest
strategy:
matrix:
rid: [linux_x64, win_x64, osx_x64, osx_arm64]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Restore
run: |
chmod +x build.sh
./build.sh restore
- name: Build
run: |
./build.sh publish \
--runtime ${{ matrix.rid }} \
--skip restore \
--version ${{ needs.determine-version.outputs.nugetVer }} \
--assembly-version ${{ needs.determine-version.outputs.asmVer }} \
--informational-version ${{ needs.determine-version.outputs.infoVer }}
- if: ${{ matrix.rid == 'linux_x64' }}
name: Download libOpenCvSharpExtern.so
env:
GH_TOKEN: ${{ github.token }}
run: |
PACKAGES_JSON=`dotnet list src/Beutl.Engine/Beutl.Engine.csproj package --framework net8.0 --format json`
#4.9.0.2024
OPENCVSHARP_VERSION=`echo $PACKAGES_JSON | jq -r '.projects[0].frameworks[0].topLevelPackages | map(select(.id == "OpenCvSharp4"))[0].requestedVersion'`
echo $OPENCVSHARP_VERSION
#4.9.0
OPENCV_VERSION=`echo $OPENCVSHARP_VERSION | cut -d '.' -f 1-3`
echo $OPENCV_VERSION
#GitのタグとNuGetのバージョンが違う場合があるので
RELEASES_JSON=`gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/shimat/opencvsharp/releases`
FILTER='map(select(.tag_name | startswith("'$OPENCV_VERSION'")))[0].tag_name'
OPENCVSHARP_TAG=`echo "$RELEASES_JSON" | jq -r "$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/$OPENCVSHARP_TAG`
ASSET_ID=`echo "$RELEASE" | jq '.assets | map(select(.name == "libOpenCvSharpExtern.so"))[0].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/$ASSET_ID > libOpenCvSharpExtern.so
- name: Zip
run: |
./build.sh zip \
--runtime ${{ matrix.rid }} \
--skip publish \
--version ${{ needs.determine-version.outputs.nugetVer }}
- name: Save
uses: actions/upload-artifact@v4
with:
name: beutl_${{ matrix.rid }}
path: ./artifacts/