-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (82 loc) · 2.49 KB
/
Copy pathdotnet.yml
File metadata and controls
97 lines (82 loc) · 2.49 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
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
name: Publish
on:
push:
branches:
- main
tags:
- v**
workflow_dispatch:
permissions:
contents: write
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
DOTNET_NOLOGO: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
NUGET_KEY: ${{ secrets.NUGET_API_KEY || secrets.NUGET_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Build
run: dotnet build src/libs/SpeexDspSharp/SpeexDspSharp.csproj --configuration Release --nologo
- name: Pack
run: dotnet pack src/libs/SpeexDspSharp/SpeexDspSharp.csproj --configuration Release --no-build --output artifacts --nologo
- name: Upload NuGet package artifacts
uses: actions/upload-artifact@v7
with:
name: nuget-packages
path: artifacts/*.nupkg
if-no-files-found: error
- name: Publish to NuGet
shell: bash
run: |
if [ -z "$NUGET_KEY" ]; then
echo "No NuGet key configured. Skipping publish."
exit 0
fi
for package in artifacts/*.nupkg; do
dotnet nuget push "$package" \
--skip-duplicate \
--source https://api.nuget.org/v3/index.json \
--api-key "$NUGET_KEY"
done
tests:
name: Tests
runs-on: ubuntu-latest
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Run tests
run: dotnet test src/tests/SpeexDspSharp.Tests/SpeexDspSharp.Tests.csproj --configuration Release --nologo
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Run Linux native smoke tests
run: scripts/smoke-test-linux-native-assets.sh
release:
name: Release
runs-on: ubuntu-latest
needs: [publish]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Create release
run: gh release create ${{ github.ref_name }} --title "${{ github.ref_name }}" --generate-notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}