-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (39 loc) · 1.61 KB
/
Copy path_publish-cli-code.yml
File metadata and controls
49 lines (39 loc) · 1.61 KB
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
name: Publish CLI to NuGet
on:
workflow_call:
workflow_dispatch:
jobs:
publish:
name: Publish CLI release to NuGet
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v5
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Restore strong-name key from secret
run: |
echo "${{ secrets.MINDEE_SNK_B64 }}" | base64 -d > /tmp/Mindee.snk
chmod 600 /tmp/Mindee.snk
- name: Install dependencies
run: dotnet restore "src/Mindee.Cli" -p:TargetFrameworks=net8.0
- name: Build (strong-name signed)
run: dotnet build "src/Mindee.Cli" --configuration Release --no-restore -p:TargetFrameworks=net8.0 -p:MindeeStrongNameKeyFile=/tmp/Mindee.snk
- name: Pack
run: dotnet pack "src/Mindee.Cli" -c Release -p:PackAsTool=true -p:TargetFrameworks=net8.0 --no-build --no-restore --output nuget
- name: Verify strong-name (PublicKeyToken)
run: |
sudo apt-get update
sudo apt-get install -y mono-devel unzip
DLL_PATH=$(unzip -Z -1 nuget/*.nupkg | grep -m1 '/Mindee.dll$')
if [ -z "$DLL_PATH" ]; then
echo "Mindee.dll not found in packaged CLI tool."
exit 1
fi
unzip -p nuget/*.nupkg "$DLL_PATH" > /tmp/Mindee.dll
sn -T /tmp/Mindee.dll
sn -vf /tmp/Mindee.dll
- name: Publish NuGet packages to NuGet
run: dotnet nuget push nuget/*.nupkg --api-key ${{ secrets.NUGET_KEY }} --source "nuget.org" --no-symbols --skip-duplicate