1- name : Build wheels for cli
1+ name : Build & Release
22
33on :
44 push :
@@ -20,11 +20,11 @@ jobs:
2020 target : x86_64
2121 rid : linux-x64
2222 manylinux : manylinux_2_34
23- # - runner: ubuntu-22.04
23+ # - runner: ubuntu-22.04 # disabled: lz c dep doesn't build
2424 # target: aarch64
2525 # rid: linux-arm64
2626 # manylinux: manylinux_2_34
27- # Linux musllinux
27+ # # Linux musllinux # disabled: dotnet still references glibc
2828 # - runner: ubuntu-22.04
2929 # target: x86_64
3030 # rid: linux-musl-x64
@@ -61,21 +61,43 @@ jobs:
6161 ref : wip
6262 path : TypeTreeGeneratorAPI
6363 - name : Publish TypeTreeGeneratorAPI with dotnet
64- run : dotnet publish TypeTreeGeneratorAPI/TypeTreeGeneratorAPI -o tt-api-lib --runtime ${{ matrix.rid }} -p:EnableAssetRipper=false -p:EnableAssetStudio=false -p:EnableAssetsTools=true -p:EnableIL2CPP=false
65- - name : Copy importlib to output
64+ run : dotnet publish TypeTreeGeneratorAPI/TypeTreeGeneratorAPI -o out --runtime ${{ matrix.rid }} -p:EnableAssetRipper=false -p:EnableAssetStudio=false -p:EnableAssetsTools=true -p:EnableIL2CPP=false
65+ - name : Copy importlib to out
6666 if : runner.os == 'windows'
67- run : cp TypeTreeGeneratorAPI/TypeTreeGeneratorAPI/bin/Release/net9.0/win-x64/native/TypeTreeGeneratorAPI.lib ./tt-api-lib/
67+ run : cp TypeTreeGeneratorAPI/TypeTreeGeneratorAPI/bin/Release/net9.0/win-x64/native/TypeTreeGeneratorAPI.lib ./out/
68+
69+ - name : Build bindings
70+ env :
71+ RUSTFLAGS : " -L out"
72+ run : cargo build --release -p bindings
73+ - name : Copy artifacts
74+ shell : bash # todo: replace this with --artifact-dir when finally stable
75+ run : |
76+ if [[ "${{ runner.os }}" == "Windows" ]]; then
77+ cp target/release/unityscenerepacker.dll out/unityscenerepacker.dll
78+ elif [[ "${{ runner.os }}" == "macOS" ]]; then
79+ cp target/release/libunityscenerepacker.dylib out/libunityscenerepacker.dylib
80+ else
81+ cp target/release/libunityscenerepacker.so out/libunityscenerepacker.so
82+ fi
83+
84+ - name : Upload bindings
85+ uses : actions/upload-artifact@v4
86+ with :
87+ name : bindings-${{ matrix.rid }}
88+ path : out/*
6889
69- - name : Build wheels
90+ - name : Build cli wheels
7091 env :
71- RUSTFLAGS : " -L tt-api-lib "
72- LD_LIBRARY_PATH : " ${{ github.workspace }}/tt-api-lib "
92+ RUSTFLAGS : " -L out "
93+ LD_LIBRARY_PATH : " ${{ github.workspace }}/out "
7394 uses : jakobhellermann/maturin-action@allow-ld-env
7495 with :
7596 target : ${{ matrix.target }}
7697 args : --release --out dist
7798 sccache : ${{ !startsWith(github.ref, 'refs/tags/') }}
7899 manylinux : ${{ matrix.manylinux }}
100+
79101 - name : Upload wheels
80102 uses : actions/upload-artifact@v4
81103 with :
@@ -97,6 +119,33 @@ jobs:
97119 name : wheels-sdist
98120 path : dist
99121
122+ nuget :
123+ name : Pack and Push NuGet Package
124+ runs-on : ubuntu-latest
125+ needs : build
126+
127+ steps :
128+ - uses : actions/checkout@v4
129+ - run : sudo apt install mono-devel # https://github.com/NuGet/setup-nuget/issues/168
130+ - uses : nuget/setup-nuget@v2
131+
132+ - name : Download artifacts
133+ uses : actions/download-artifact@v4
134+ with :
135+ pattern : bindings-*
136+ path : out
137+
138+ - name : List built files
139+ run : ls -R out
140+
141+ - name : Pack NuGet package
142+ run : nuget pack ./bindings/unityscenerepacker.nuspec
143+
144+ - name : Push to NuGet
145+ env :
146+ NUGET_API_KEY : ${{ secrets.NUGET_API_KEY }}
147+ run : nuget push unityscenerepacker.*.nupkg --skip-duplicate -Source https://api.nuget.org/v3/index.json -ApiKey $NUGET_API_KEY
148+
100149 release :
101150 name : Release
102151 runs-on : ubuntu-latest
@@ -111,6 +160,8 @@ jobs:
111160 attestations : write
112161 steps :
113162 - uses : actions/download-artifact@v4
163+ with :
164+ pattern : wheels-*
114165 - name : Generate artifact attestation
115166 uses : actions/attest-build-provenance@v2
116167 with :
0 commit comments