Repository navigation
87 lines (74 loc) · 2.74 KB
/
Copy pathbuild-package-flow.yml
File metadata and controls
87 lines (74 loc) · 2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Build & Test workflow
on:
workflow_call:
inputs:
cmd-arguments:
description: 'Command line arguments'
default: '/overrideconfig mode=ContinuousDeployment'
required: false
type: string
artifact-name:
description: 'A name to be used to publish artifact'
default: 'Package'
required: false
type: string
solution-path:
description: 'Path and name of the solution file'
default: 'package.sln'
required: false
type: string
jobs:
build:
runs-on: windows-latest
env:
DOTNET_NOLOGO: '1'
DOTNET_CLI_TELEMETRY_OPTOUT: '1'
PackageOutputPath: '${{ github.workspace }}\package'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Retrieve the certificate
run: |
mkdir -p eng/signing
echo $CERTIFICATE_BASE64 | base64 -d > eng/signing/package.snk
echo $TOKEN_BASE64 | base64 -d > eng/signing/token.snk
shell: bash
env:
CERTIFICATE_BASE64: ${{secrets.CERTIFICATE_BASE64}}
TOKEN_BASE64: ${{secrets.TOKEN_BASE64}}
- name: Label Fixed Issues
uses: gh-bot/fix-labeler@master
- name: GitVersion
run: |
# choco install gitversion.portable -pre -y --no-progress
dotnet tool install --global GitVersion.Tool --version 5.12.*
dotnet gitversion /l console /output buildserver ${{ inputs.cmd-arguments }}
# - name: Setup .NET Core SDK
# uses: actions/setup-dotnet@v3
# with:
# dotnet-version: '6.0'
- name: Add GitHub nuget feed
run: |
dotnet nuget add source "https://nuget.pkg.github.com/unitycontainer/index.json" -n github -u unitycontainer -p ${{secrets.GITHUB_TOKEN}} --store-password-in-clear-text
- name: Build
env:
VersionMajor: '${{ env.GitVersion_Major }}'
VersionMinor: '${{ env.GitVersion_Minor }}'
VersionPatch: '${{ env.GitVersion_Patch }}'
Version: '${{ env.GitVersion_MajorMinorPatch }}'
FileVersion: '${{ env.GitVersion_AssemblySemFileVer }}'
PackageVersion: '${{ env.GitVersion_FullSemVer }}'
AssemblyVersion: '${{ env.GitVersion_AssemblySemVer }}'
InformationalVersion: '${{ env.GitVersion_InformationalVersion }}'
run: |
dotnet msbuild -property:Configuration=Release -verbosity:m -restore:True ${{ inputs.solution-path }}
- name: Test
run: |
dotnet test --no-restore --no-build --configuration Release ${{ inputs.solution-path }}
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: '${{ inputs.artifact-name }}'
path: '${{ env.PackageOutputPath }}'