diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 64c285c1..e1bd6490 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -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 diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index fb054a7f..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,47 +0,0 @@ -version: '{build}' -branches: - only: - - develop -image: Visual Studio 2022 -init: - - cmd: | - set GITVERSION_BUILD_NUMBER=%APPVEYOR_BUILD_NUMBER% - if defined APPVEYOR_PULL_REQUEST_NUMBER set GitVersion_NoNormalizeEnabled=true - if defined APPVEYOR_PULL_REQUEST_NUMBER set IGNORE_NORMALISATION_GIT_HEAD_MOVE=1 -install: - - choco install gitversion.portable -pre -y -nuget: - disable_publish_on_pr: true - disable_publish_octopus: true -before_build: - - pwsh: | - if ($APPVEYOR_PULL_REQUEST_NUMBER) - { - git checkout -b PR-$APPVEYOR_PULL_REQUEST_NUMBER - gitversion /l console /output buildserver /nonormalize - } - else - { - gitversion /l console /output buildserver - } - - cmd: | - msbuild l10n\l10n.proj /t:restore - msbuild l10n\l10n.proj /t:CopyL10nsToDistFiles -build: - project: build/FLExBridge.proj - publish_nuget: true - publish_nuget_symbols: true - use_snupkg_format: true - verbosity: normal -test: off -artifacts: -- path: output/*nupkg - name: nuget -deploy: -- provider: Environment - name: sil-lsdev nuget -notifications: -- provider: GitHubPullRequest - on_build_success: false - on_build_failure: false - on_build_status_changed: false