forked from olegtarasov/FastText.NetWrapper
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (36 loc) · 1.33 KB
/
publish.yml
File metadata and controls
43 lines (36 loc) · 1.33 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
name: Publish FastText.NetWrapper
on:
release:
types:
- published # Run the workflow when a new GitHub release is published
workflow_dispatch: # Allow manual triggering from the GitHub UI
# Set permissions for the workflow.
permissions:
contents: write
packages: write
checks: write
pull-requests: write
id-token: write # Required for NuGet trusted publishing (OIDC)
jobs:
build:
uses: ./.github/workflows/ci.yml
publish:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download Package
uses: actions/download-artifact@v4.1.3
with:
name: artifacts
path: bin/artifacts/
- name: Publish NuGet Packages to GitHub Packages
run: dotnet nuget push bin/artifacts/**/*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json --skip-duplicate
- name: NuGet login (OIDC → temp API key)
if: github.event_name == 'release'
uses: NuGet/login@v1
id: login
with:
user: ${{ secrets.NUGET_USER }}
- name: Publish NuGet package
if: github.event_name == 'release'
run: dotnet nuget push bin/artifacts/**/*.nupkg --api-key "${{steps.login.outputs.NUGET_API_KEY}}" --source "https://api.nuget.org/v3/index.json" --skip-duplicate