feat: Add support for AutoNSubstitute
(#15)
#36
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Nuget packages | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
types: | |
- opened | |
- synchronize | |
env: | |
DOTNET_VERSION: 6.0.201 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Build | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build & test - User | |
if: github.actor != 'dependabot[bot]' | |
uses: ./.github/actions/build-test | |
with: | |
nuget-add-update-source-commands: dotnet nuget update source GitHub --configfile nuget.config --username ${{ github.actor }} --password ${{ secrets.GHCR_PULL_TOKEN }} --store-password-in-clear-text | |
dotnet-version: ${{ env.DOTNET_VERSION }} | |
test-projects-directory-path: './test' | |
- name: Build & test - Dependabot | |
if: github.actor == 'dependabot[bot]' | |
uses: ./.github/actions/build-test | |
with: | |
nuget-add-update-source-commands: dotnet nuget update source GitHub --configfile nuget.config --username ${{ github.actor }} --password ${{ secrets.GH_PACKAGES_READ_TOKEN }} --store-password-in-clear-text | |
dotnet-version: ${{ env.DOTNET_VERSION }} | |
test-projects-directory-path: './test' | |
- name: Publish Unit Test Results | |
uses: EnricoMi/[email protected] | |
if: always() | |
with: | |
files: ./test/**/TestResults/*.xml | |
- name: Upload beta NuGet to Packages | |
uses: ./.github/actions/upload-nuget | |
with: | |
nuget-pack-command: dotnet pack -c Release -o release/beta --no-restore --version-suffix beta-${{github.run_id}} | |
package-path: release | |
- name: Upload prod NuGet to Packages | |
uses: ./.github/actions/upload-nuget | |
with: | |
nuget-pack-command: dotnet pack -c Release -o release --no-restore | |
package-path: release | |
Publish-Beta: | |
name: Publish beta package | |
environment: | |
name: Development - Nuget | |
runs-on: ubuntu-latest | |
needs: Build | |
if: ${{ success() }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Publish NuGet package | |
uses: ./.github/actions/publish-nuget | |
with: | |
package-path: beta\*.nupkg | |
token: ${{ secrets.GITHUB_TOKEN }} | |
dotnet-version: ${{ env.DOTNET_VERSION }} | |
Publish-Production: | |
name: Publish production package to GitHub/MaerskTech | |
environment: | |
name: Production - Nuget | |
runs-on: ubuntu-latest | |
needs: Build | |
if: ${{ success() && github.ref == 'refs/heads/main' }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Publish NuGet package | |
uses: ./.github/actions/publish-nuget | |
with: | |
package-path: '*.nupkg' | |
token: ${{ secrets.GITHUB_TOKEN }} | |
dotnet-version: ${{ env.DOTNET_VERSION }} | |
Publish-NugetDotOrg: | |
name: Publish production package to nuget.org | |
environment: | |
name: Production - Nuget.org | |
runs-on: ubuntu-latest | |
needs: Build | |
if: ${{ success() && github.ref == 'refs/heads/main' }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Publish NuGet package | |
uses: ./.github/actions/publish-nuget | |
with: | |
package-source: https://api.nuget.org/v3/index.json | |
package-path: '*.nupkg' | |
token: ${{ secrets.NUGET_ORG_TOKEN }} | |
dotnet-version: ${{ env.DOTNET_VERSION }} |