Skip to content

Commit

Permalink
Add NuGet packaging step to CI/CD workflow (#405)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
rmunn and megahirt authored Jul 9, 2024
1 parent 2174e95 commit 8680485
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 47 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,28 @@ jobs:
shell: cmd
run: msbuild build\FLExBridge.proj /t:Test /p:Configuration=Release

- name: Create NuGet packages
shell: cmd
run: msbuild build\FLExBridge.proj /t:Pack /p:Configuration=Release

- name: Upload NuGet packages to build artifacts
uses: actions/upload-artifact@v4
with:
name: nuget-packages
path: output/*nupkg
if-no-files-found: warn

# --skip-duplicate allows retrying a workflow that failed with a partial push, skipping already published packages and publishing the rest.
- name: Publish NuGet packages to nuget.org
run: |
foreach ($pkg in (Get-ChildItem -Path output -Name -Filter *nupkg)) {
dotnet nuget push output/$pkg --skip-duplicate --api-key $env:NUGET_API_KEY --source https://api.nuget.org/v3/index.json
}
env:
NUGET_API_KEY: ${{ secrets.SILLSDEV_PUBLISH_NUGET_ORG }}
if: github.event_name != 'pull_request'
continue-on-error: true

# All the following are used only when building an installer after a merge
- name: Build Msi
id: build_msi
Expand Down
47 changes: 0 additions & 47 deletions appveyor.yml

This file was deleted.

0 comments on commit 8680485

Please sign in to comment.