-
Notifications
You must be signed in to change notification settings - Fork 185
104 lines (87 loc) · 3.25 KB
/
compiler-python-release.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
name: compiler-python-release
on: [push, pull_request]
concurrency:
group: compiler-python-release-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' && !startsWith(github.ref, 'refs/heads/release/') }}
jobs:
build-compiler:
name: build-${{matrix.config.name}}
runs-on: ${{matrix.config.os}}
strategy:
matrix:
dotnet-version: ['8.0']
config:
# - {name: aarch64-macos, os: macos-14, shell: bash, rid: osx-arm64, buildType: Release}
- {name: x86_64-linux, os: ubuntu-24.04, shell: bash, rid: linux-x64, buildType: Release}
# - {name: x86_64-windows, os: windows-latest, shell: bash, rid: win-x64, buildType: Release}
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{matrix.dotnet-version}}
- name: Cache NuGet packages
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Build
run: |
dotnet restore -r ${{matrix.config.rid}}
dotnet publish src/Nncase.Compiler -c ${{matrix.config.buildType}} --no-restore --sc false -r ${{matrix.config.rid}}
- name: Upload nncase Build Artifact
uses: actions/upload-artifact@v4
with:
name: nncase-${{matrix.config.name}}
path: ${{github.workspace}}/src/Nncase.Compiler/bin/${{matrix.config.buildType}}/net${{matrix.dotnet-version}}/${{matrix.config.rid}}/publish
if-no-files-found: error
build-native:
needs: [build-compiler]
name: build-native-${{matrix.config.name}}
runs-on: ${{matrix.config.os}}
strategy:
matrix:
dotnet-version: ['8.0']
config:
# - {name: aarch64-macos, os: macos-14}
- {name: x86_64-linux, os: ubuntu-24.04}
# - {name: x86_64-windows, os: windows-latest, arch: x64}
env:
VULKANSDK_VER: 1.3.268.0
steps:
- uses: actions/checkout@v3
- uses: seanmiddleditch/gha-setup-ninja@master
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{matrix.dotnet-version}}
- name: Install nncase
uses: actions/download-artifact@v4
with:
name: nncase-${{matrix.config.name}}
path: ${{github.workspace}}/install
- name: Set up build environment (Windows, Visual Studio)
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{matrix.config.arch}}
if: runner.os == 'Windows'
- name: Set up build environment (Macos)
run: |
brew install sunnycase/core/[email protected]
if: runner.os == 'Macos'
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install cibuildwheel
run: pip install cibuildwheel
- name: Build wheel
run: python -m cibuildwheel --output-dir wheelhouse
- name: Upload nncase-python Build Artifact
uses: actions/upload-artifact@v4
with:
name: nncase-python-${{matrix.config.name}}
path: ${{github.workspace}}/wheelhouse
if-no-files-found: error