Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Summpot committed Oct 30, 2023
1 parent 9ba2e6f commit e9c75bf
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 13 deletions.
57 changes: 46 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
tags: [ "v*" ]

jobs:
build:
build-runtime-package:
strategy:
matrix:
rid:
Expand All @@ -21,27 +21,62 @@ jobs:
include:
- { os: ubuntu-latest, rid: linux-x64 }
- { os: ubuntu-latest, rid: linux-arm64 }
- { os: macos-latest, rid: osx-arm64 }
- { os: macos-latest, rid: osx-x64 }
- { os: windows-latest, rid: win-arm64 }
- { os: windows-latest, rid: win-x64 }
- { os: windows-latest, rid: win-x86 }
- { os: ubuntu-latest, rid: osx-arm64 }
- { os: ubuntu-latest, rid: osx-x64 }
- { os: ubuntu-latest, rid: win-arm64 }
- { os: ubuntu-latest, rid: win-x64 }
- { os: ubuntu-latest, rid: win-x86 }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
submodules: "true"
fetch-depth: 0

- name: Install .NET Sdk
uses: actions/setup-dotnet@v3
with:
global-json-file: global.json

- name: Do release

- name: Do pack
run: |
dotnet build native/native.csproj -p:Configuration=Release -p:RuntimeIdentifier=${{ matrix.rid }}
dotnet pack src/NativeLibrary/NativeLibrary.runtime.csproj -p:RuntimeIdentifier=${{ matrix.rid }}
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: Artifacts
path: "nupkgs"

build-main-package:
needs: build-runtime-package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install .NET Sdk
uses: actions/setup-dotnet@v3
with:
global-json-file: global.json

- uses: actions/download-artifact@v3
with:
name: Artifacts
path: "nupkgs"

- name: Do pack
run: |
dotnet pack -p:RuntimeIdentifier=${{ matrix.rid }}
dotnet pack src/NativeLibrary/NativeLibrary.csproj
dotnet pack
- name: Push packages to nuget
run: |
Get-ChildItem ./nupkgs -Filter *.nupkg | %{ dotnet nuget push $_.FullName -k ${{secrets.NUGET_API_KEY}} }
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
Expand Down
8 changes: 6 additions & 2 deletions nuget.config
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<add key="defaultPushSource" value="https://nuget.org" />
</config>
<packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<!--To
inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
<add key="Local Source" value="./nupkgs" />
</packageSources>
</configuration>
</configuration>

0 comments on commit e9c75bf

Please sign in to comment.