Update ci-msbuild nuget and add Aserto Middleware nuspec #23
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: ci-msbuild | |
on: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
- v* | |
# Publish `v1.2.3` tags as releases. | |
tags: | |
- v* | |
# Run tests for PRs | |
pull_request: | |
env: | |
VAULT_ADDR: https://vault.eng.aserto.com/ | |
jobs: | |
build: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
cfg: | |
- { project: Aserto.Clients } | |
- { project: Aserto.Middleware } | |
name: Build ${{ matrix.cfg.project }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Add msbuild to PATH | |
uses: microsoft/setup-msbuild@v2 | |
- name: Setup Nuget | |
uses: Nuget/setup-nuget@v2 | |
- name: Restore nuget packages | |
run: nuget restore aserto-dotnet.sln | |
- name: Build app for release | |
run: msbuild src\${{matrix.cfg.project}}\${{matrix.cfg.project}}.csproj -t:rebuild -verbosity:diag -property:Configuration=Release | |
release: | |
runs-on: windows-latest | |
needs: build | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
strategy: | |
matrix: | |
cfg: | |
- { project: Aserto.Middleware } | |
name: Build ${{ matrix.cfg.project }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Read Configuration | |
uses: hashicorp/vault-action@v3 | |
id: vault | |
with: | |
url: ${{ env.VAULT_ADDR }} | |
token: ${{ secrets.VAULT_TOKEN }} | |
secrets: | | |
kv/data/nuget "NUGET_API_KEY" | NUGET_API_KEY; | |
- name: Add msbuild to PATH | |
uses: microsoft/setup-msbuild@v2 | |
- name: Setup Nuget | |
uses: Nuget/setup-nuget@v2 | |
- name: Restore nuget packages | |
run: nuget restore aserto-dotnet.sln | |
- name: Build app for release | |
run: msbuild src\${{matrix.cfg.project}}\${{matrix.cfg.project}}.csproj -t:rebuild -verbosity:diag -property:Configuration=Release | |
- name: Pack and push nuget | |
run: | | |
cd src\${{matrix.cfg.project}} | |
nuget pack | |
nuget push *.nupkg -ApiKey $Env:NUGET_API_KEY -Source https://api.nuget.org/v3/index.json | |