Skip to content
This repository has been archived by the owner on Nov 28, 2024. It is now read-only.

CI

CI #3

Workflow file for this run

name: CI
on:
# Allow manual build
workflow_dispatch:
# Build on push to main
push:
branches:
- main
paths:
- '**/**'
- '!docs/**'
- '!build/**'
- '!azure-pipelines*'
- '!**/*.md'
- '!**/*.txt'
- '!**/unit-tests.yml'
- '!**/codeql.yml'
# Build every 6 months if not built already
schedule:
- cron: '0 1 1 */6 *'
jobs:
build-project:
name: Build Project
runs-on: windows-latest
steps:
- name: Checkout repository
id: checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.x
8.x
- uses: nuget/setup-nuget@v2
with:
nuget-version: 'latest'
nuget-api-key: ${{ secrets.AZDO_NUGET_REPO }}
- uses: wcenterprises/digital-is-build-actions/[email protected]
id: build-init
with:
package-name: 'Jh.Sample'
azdo-token: '${{ secrets.AZDO_NUGET_REPO }}'
artifactory-username: ${{ secrets.ARTIFACTORY_USERNAME }}
artifactory-password: ${{ secrets.ARTIFACTORY_PASSWORD }}
- name: restore
run: |
dotnet restore 'Jh.Sample.sln'
shell: pwsh
- name: build
run: |
write-output "##[group]build: Jh.Sample.sln"
dotnet build 'Jh.Sample.sln' `
--no-restore `
--configuration release `
-p:Copyright="${{ steps.build-init.outputs.package-copyright }}" `
-p:Authors="${{ steps.build-init.outputs.package-authors }}" `
-p:Company="${{ steps.build-init.outputs.package-company }}" `
-p:AssemblyVersion="${{ steps.build-init.outputs.version-prefix }}" `
-p:FileVersion="${{ steps.build-init.outputs.version-prefix }}" `
-p:InformationalVersion="${{ steps.build-init.outputs.version-informational }}+${{ github.sha }}" `
-p:TrimUnusedDependencies=true `
-p:IsOnBuildAgent=true `
-p:CodeAnalysisTreatWarningsAsErrors=true `
-warnaserror `
-p:_SkipUpgradeNetAnalyzersNuGetWarning=true
write-output "##[endgroup]"
shell: pwsh
working-directory: '${{ github.workspace }}/source'
- name: publish
run: |
write-output "##[group]publish: Jh.Sample.sln"
dotnet publish Jh.Sample.sln `
--property:PublishDir="${{ steps.build-init.outputs.build-output-path }}" `
--configuration release `
--no-build `
--no-self-contained `
--no-restore `
--nologo `
-p:TrimUnusedDependencies=true `
-p:ErrorOnDuplicatePublishOutputFiles=false
write-output "##[endgroup]"
shell: pwsh
working-directory: '${{ github.workspace }}/source'
- uses: wcenterprises/digital-is-build-actions/[email protected]
- uses: wcenterprises/digital-is-build-actions/[email protected]