Skip to content

Changed from class to record in messages #72

Changed from class to record in messages

Changed from class to record in messages #72

# Copyright (c) 2024 Distributed Medical AB. All rights reserved.
name: Build and publish
on:
push:
branches:
- 'main'
- 'feature**'
- 'dev**'
jobs:
build:
strategy:
matrix:
configuration:
- Release
project:
- 'VidiView.Api.DataModel'
- 'VidiView.Api.Helpers'
runs-on: windows-latest
permissions:
contents: read
packages: write
env:
SOLUTION: VidiView.Api.sln
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x
- name: Setup NuGet
uses: nuget/setup-nuget@v2
- name: NuGet add source with credentials
run: nuget sources Add -name "dm-vidiview" -source "https://nuget.pkg.github.com/distributed-medical/index.json" -username "github_action" -password ${{ secrets.GITHUB_TOKEN }} -StorePasswordInClearText
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '6.x'
- name: Determine Version
id: version_step # step id used as reference for output values
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
- name: Update project file
uses: gittools/actions/gitversion/[email protected]
with:
arguments: '/updateprojectfiles /updateassemblyinfo /verbosity Diagnostic'
- name: Build and test
run: |
dotnet build ${{ matrix.project }} --configuration ${{ matrix.configuration }}
dotnet test ${{ matrix.project }}.Test --configuration ${{ matrix.configuration }}
- name: Sign binaries
uses: azure/[email protected]
with:
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }}
endpoint: https://weu.codesigning.azure.net/ # Western Europe
trusted-signing-account-name: DMCodesigning
certificate-profile-name: DMCodesigning
files-folder: ${{ matrix.project }}\bin\Release\net7.0\
files-folder-filter: dll
file-digest: SHA256
timestamp-rfc3161: http://timestamp.acs.microsoft.com
timestamp-digest: SHA256
- name: Pack
run: dotnet pack ${{ matrix.project }} --configuration ${{ matrix.configuration }} --no-build --no-restore
# - name: Sign NuGet package
# uses: azure/[email protected]
# with:
# azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
# azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
# azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }}
# endpoint: https://weu.codesigning.azure.net/ # Western Europe
# trusted-signing-account-name: DMCodesigning
# certificate-profile-name: DMCodesigning
# files-folder: ${{ matrix.project }}\bin\Release\
# files-folder-filter: nupkg
# file-digest: SHA256
# timestamp-rfc3161: http://timestamp.acs.microsoft.com
# timestamp-digest: SHA256
- name: Publish package
# #if: github.ref == 'refs/heads/main'
run: dotnet nuget push **\${{ matrix.project }}*.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s "dm-vidiview" --skip-duplicate