-
-
Notifications
You must be signed in to change notification settings - Fork 68
41 lines (32 loc) · 1.41 KB
/
Copy pathnuget_build_release.yml
File metadata and controls
41 lines (32 loc) · 1.41 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
name: "Publish to NuGet Gallery"
on:
release:
types: [published]
env:
PROJECT_PATH: ATL/ATL.csproj
PACKAGE_OUTPUT_DIRECTORY: ${{ github.workspace }}/build-output
NUGET_SOURCE_URL: "https://api.nuget.org/v3/index.json"
jobs:
publish:
name: "Publish to NuGet Gallery"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout"
uses: actions/checkout@v6
- name: "Install Dotnet"
uses: actions/setup-dotnet@v5
with:
dotnet-version: "8.0.x"
- name: "Create NuGet release note file"
run: |
cat << 'EOF-WORKFLOW' > PACKAGE-RELEASE-NOTES.txt
${{ github.event.release.body }}
EOF-WORKFLOW
- name: "Restore packages"
run: dotnet restore "${{ env.PROJECT_PATH }}"
- name: "Build project"
run: dotnet build "${{ env.PROJECT_PATH }}" --no-restore --configuration Release -p:Version=${{ github.event.release.tag_name }} -p:FileVersion=${{ github.event.release.tag_name }}
- name: "Pack project"
run: dotnet pack "${{ env.PROJECT_PATH }}" -p:PackageVersion=${{ github.event.release.tag_name }} --no-restore --no-build --configuration Release --output "${{ env.PACKAGE_OUTPUT_DIRECTORY }}"
- name: "Push package"
run: dotnet nuget push "${{ env.PACKAGE_OUTPUT_DIRECTORY }}/*.nupkg" --source ${{ env.NUGET_SOURCE_URL }} --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate