Skip to content

Commit 8680485

Browse files
rmunnmegahirt
andauthored
Add NuGet packaging step to CI/CD workflow (#405)
* Add NuGet packaging step to CI/CD workflow For now this just uploads to build artifacts; we will upload to nuget.org once we've tested that the packages are built correctly. * Add step to publish NuGet packages Requires the GitHub org secret named SILLSDEV_PUBLISH_NUGET_ORG to be present in the org and reachable from this repo. * Remove Appveyor CI We don't want two build processes pushing to nuget.org. * Push .snupkg files as well as .nupkg * Continue workflow if pushing NuGet packages fails --------- Co-authored-by: Christopher Hirt <chris@hirtfamily.net>
1 parent 2174e95 commit 8680485

File tree

2 files changed

+22
-47
lines changed

2 files changed

+22
-47
lines changed

.github/workflows/ci-cd.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,28 @@ jobs:
9696
shell: cmd
9797
run: msbuild build\FLExBridge.proj /t:Test /p:Configuration=Release
9898

99+
- name: Create NuGet packages
100+
shell: cmd
101+
run: msbuild build\FLExBridge.proj /t:Pack /p:Configuration=Release
102+
103+
- name: Upload NuGet packages to build artifacts
104+
uses: actions/upload-artifact@v4
105+
with:
106+
name: nuget-packages
107+
path: output/*nupkg
108+
if-no-files-found: warn
109+
110+
# --skip-duplicate allows retrying a workflow that failed with a partial push, skipping already published packages and publishing the rest.
111+
- name: Publish NuGet packages to nuget.org
112+
run: |
113+
foreach ($pkg in (Get-ChildItem -Path output -Name -Filter *nupkg)) {
114+
dotnet nuget push output/$pkg --skip-duplicate --api-key $env:NUGET_API_KEY --source https://api.nuget.org/v3/index.json
115+
}
116+
env:
117+
NUGET_API_KEY: ${{ secrets.SILLSDEV_PUBLISH_NUGET_ORG }}
118+
if: github.event_name != 'pull_request'
119+
continue-on-error: true
120+
99121
# All the following are used only when building an installer after a merge
100122
- name: Build Msi
101123
id: build_msi

appveyor.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)