Fix#: use runtimes folder instead of native lib #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 'Build and release NuGet package' | |
| on: | |
| push: | |
| release: | |
| types: | |
| - published | |
| jobs: | |
| build-native: | |
| name: 'Build native library' | |
| runs-on: windows-latest | |
| outputs: | |
| native-id: ${{ steps.artup.outputs.artifact-id }} | |
| steps: | |
| - name: 'Checkout repo' | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: 'Install msbuild' | |
| uses: microsoft/setup-msbuild@30375c66a4eea26614e0d39710365f22f8b0af57 # v3 | |
| - name: 'Install NuGet' | |
| uses: NuGet/setup-nuget@fd55a6f3b34392fa83fde1454582407d8c714123 # v4.0 | |
| - name: 'Restore NuGet packages' | |
| run: nuget restore Native\ApplicationLoopback.vcxproj -PackagesDirectory Native\packages | |
| - name: 'Build project' | |
| run: msbuild /t:build /p:Platform=x64 /p:Configuration=Release Native\ApplicationLoopback.vcxproj | |
| - name: 'Upload artifact' | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| id: artup | |
| with: | |
| name: 'native-lib' | |
| path: Native\x64\Release\ApplicationLoopback.dll | |
| build-publish: | |
| name: 'Build and push NuGet' | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build-native | |
| env: | |
| IS_RELEASE: ${{ github.event_name == 'release' && github.event.action == 'published' }} | |
| steps: | |
| - name: 'Checkout repo' | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: 'Download native lib' | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| artifact-ids: ${{ needs.build-native.outputs.native-id }} | |
| - name: 'Move native lib' | |
| run: | | |
| mkdir -pv ApplicationLoopback.NET/ApplicationLoopback.NET/runtimes/win-x64/ | |
| mv ApplicationLoopback.dll ApplicationLoopback.NET/ApplicationLoopback.NET/runtimes/win-x64/ | |
| - name: 'Build NuGet' | |
| uses: Yellow-Dog-Man/composite-actions-templates/.github/actions/dotnet-build@606ac289d701be7b7d90e5ff8647dedf57d6d755 # main | |
| with: | |
| dotnet-build-args: ${{ env.IS_RELEASE == 'true' && format('-p:Version={0} -o nupkgs', github.ref_name) || '-o nupkgs' }} | |
| dotnet-project-path: 'ApplicationLoopback.NET/ApplicationLoopback.NET/ApplicationLoopback.NET.csproj' | |
| dotnet-build-type: 'pack' | |
| - name: 'Upload artifact' | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: 'nuget-packages' | |
| path: nupkgs/*.nupkg | |
| - name: 'Push nuget' | |
| if: ${{ env.IS_RELEASE == 'true' }} | |
| uses: Yellow-Dog-Man/composite-actions-templates/.github/actions/dotnet-build-push-nuget@606ac289d701be7b7d90e5ff8647dedf57d6d755 # main | |
| with: | |
| dotnet-nuget-auth-token: ${{ secrets.NUGET_TOKEN }} |