-
Notifications
You must be signed in to change notification settings - Fork 0
204 lines (199 loc) · 8.15 KB
/
build.yml
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
name: .NET 8 Build and Publish
env:
DOTNET_VERSION: "8.x"
OUTPUT_PATH: ${{ github.workspace }}/artifact
ASSEMBLY_VERSION: 1.0.0.${{ github.run_number }}
ADR_PROJECT_FILE: "adr-power-cli.csproj"
ADR_TESTPROJECT_CORE_FILE: "adr-core-tests.csproj"
ADR_TESTPROJECT_CLI_FILE: "adr-cli-tests.csproj"
ADR_PROJECT_FILE_PATH: "./src/cli/adr-power-cli.csproj"
WINDOWS_RUNTIME: "win-x64"
UBUNTU_RUNTIME: "linux-x64"
CONFIGURATION: "Release"
ADR_SOLUTION_FILE: "adr-power-cli.sln"
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
name: Build all
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Fetch all history for all tags and branches
run: git fetch --unshallow || true
#
# - name: Install GitVersion
# uses: gittools/actions/gitversion/[email protected]
# with:
# versionSpec: "5.x"
#
# - name: Use GitVersion
# id: gitversion # step id used as reference for output values
# uses: gittools/actions/gitversion/[email protected]
#
# - run: |
# echo "Major: ${{ steps.gitversion.outputs.major }}"
# echo "Minor: ${{ steps.gitversion.outputs.minor }}"
# echo "Patch: ${{ steps.gitversion.outputs.patch }}"
# echo "PreReleaseTag: ${{ steps.gitversion.outputs.preReleaseTag }}"
# echo "PreReleaseTagWithDash: ${{ steps.gitversion.outputs.preReleaseTagWithDash }}"
# echo "PreReleaseLabel: ${{ steps.gitversion.outputs.preReleaseLabel }}"
# echo "PreReleaseNumber: ${{ steps.gitversion.outputs.preReleaseNumber }}"
# echo "WeightedPreReleaseNumber: ${{ steps.gitversion.outputs.weightedPreReleaseNumber }}"
# echo "BuildMetaData: ${{ steps.gitversion.outputs.buildMetaData }}"
# echo "BuildMetaDataPadded: ${{ steps.gitversion.outputs.buildMetaDataPadded }}"
# echo "FullBuildMetaData: ${{ steps.gitversion.outputs.fullBuildMetaData }}"
# echo "MajorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}"
# echo "SemVer: ${{ steps.gitversion.outputs.semVer }}"
# echo "LegacySemVer: ${{ steps.gitversion.outputs.legacySemVer }}"
# echo "LegacySemVerPadded: ${{ steps.gitversion.outputs.legacySemVerPadded }}"
# echo "AssemblySemVer: ${{ steps.gitversion.outputs.assemblySemVer }}"
# echo "AssemblySemFileVer: ${{ steps.gitversion.outputs.assemblySemFileVer }}"
# echo "FullSemVer: ${{ steps.gitversion.outputs.fullSemVer }}"
# echo "InformationalVersion: ${{ steps.gitversion.outputs.informationalVersion }}"
# echo "BranchName: ${{ steps.gitversion.outputs.branchName }}"
# echo "EscapedBranchName: ${{ steps.gitversion.outputs.escapedBranchName }}"
# echo "Sha: ${{ steps.gitversion.outputs.sha }}"
# echo "ShortSha: ${{ steps.gitversion.outputs.shortSha }}"
# echo "NuGetVersionV2: ${{ steps.gitversion.outputs.nuGetVersionV2 }}"
# echo "NuGetVersion: ${{ steps.gitversion.outputs.nuGetVersion }}"
# echo "NuGetPreReleaseTagV2: ${{ steps.gitversion.outputs.nuGetPreReleaseTagV2 }}"
# echo "NuGetPreReleaseTag: ${{ steps.gitversion.outputs.nuGetPreReleaseTag }}"
# echo "VersionSourceSha: ${{ steps.gitversion.outputs.versionSourceSha }}"
# echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.commitsSinceVersionSource }}"
# echo "CommitsSinceVersionSourcePadded: ${{ steps.gitversion.outputs.commitsSinceVersionSourcePadded }}"
# echo "UncommittedChanges: ${{ steps.gitversion.outputs.uncommittedChanges }}"
# echo "CommitDate: ${{ steps.gitversion.outputs.commitDate }}"
#
# - name: Setup .NET
# uses: actions/setup-dotnet@v3
# with:
# dotnet-version: ${{ env.DOTNET_VERSION }}
#
# - name: Display dotnet version
# run: dotnet --version
#
# - name: Install dependencies
# run: dotnet restore
#
# - name: Build
# run: dotnet build ${{ env.ADR_PROJECT_FILE}} --runtime ${{ env.WINDOWS_RUNTIME }} --configuration ${{ env.CONFIGURATION }} -p:Version=${{ steps.gitversion.outputs.nuGetVersionV2 }}
# working-directory: ./src/cli
#
# run-tests:
# name: Run tests
# needs: build
# runs-on: ubuntu-latest
# steps:
#
# - name: Execute unit testsss
# run: dotnet test ./adr-power-cli.sln
#
# # Execute all unit tests in the solution
# - name: Execute unit tests
# run: dotnet test adr-power-cli.sln
#
# - name: Test Core
# run: dotnet test tests/adr-core-tests/adr-core-tests.csproj --verbosity normal
# working-directory: tests
# publish_windows:
# name: Publish Windows package
# needs: build
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
#
# - name: Fetch all history for all tags and branches
# run: git fetch --unshallow || true
#
# - name: Install GitVersion
# uses: gittools/actions/gitversion/[email protected]
# with:
# versionSpec: "5.x"
#
# - name: Use GitVersion
# id: gitversion # step id used as reference for output values
# uses: gittools/actions/gitversion/[email protected]
#
# - name: Setup .NET
# uses: actions/setup-dotnet@v3
# with:
# dotnet-version: ${{ env.DOTNET_VERSION }}
#
# - name: Publish for Windows-x64 single executable
# # if: github.ref == 'refs/heads/master'
# run: dotnet publish ${{ env.ADR_PROJECT_FILE_PATH }} --runtime ${{ env.WINDOWS_RUNTIME}} -c ${{ env.CONFIGURATION}} /p:PublishSingleFile=true --output ${{ env.OUTPUT_PATH }}/windows-portable --verbosity detailed
#
# - name: List output result
# run: ls ${{ env.OUTPUT_PATH }}/windows-portable
#
# - name: Zip Windows-x64 artifacts
# # if: github.ref == 'refs/heads/master'
# uses: montudor/[email protected]
# with:
# args: zip -qq -r ${{ env.OUTPUT_PATH }}/ADR-CLI-tool-windows-${{ steps.gitversion.outputs.nuGetVersionV2 }}.zip ${{ env.OUTPUT_PATH }}/windows-portable/
#
# - name: Upload a Build Artifact
# # if: github.ref == 'refs/heads/master'
# uses: actions/upload-artifact@v2
# with:
# name: ADR-CLI-tool-${{ steps.gitversion.outputs.nuGetVersionV2 }}
# path: ${{ env.OUTPUT_PATH }}
# publish_linux:
# name: Publish Linux package
# needs: build
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
#
# - name: Fetch all history for all tags and branches
# run: git fetch --unshallow || true
#
# - name: Install GitVersion
# uses: gittools/actions/gitversion/[email protected]
# with:
# versionSpec: "5.x"
#
# - name: Use GitVersion
# id: gitversion # step id used as reference for output values
# uses: gittools/actions/gitversion/[email protected]
#
# - name: Setup .NET
# uses: actions/setup-dotnet@v3
# with:
# dotnet-version: ${{ env.DOTNET_VERSION }}
#
# - name: Publish for Linux-x64 single executable
## if: github.ref == 'refs/heads/master'
# run: dotnet publish ${{ env.ADR_PROJECT_FILE_PATH}} --runtime ${{ env.UBUNTU_RUNTIME}} -c ${{ env.CONFIGURATION}} /p:PublishSingleFile=true --output ${{ env.OUTPUT_PATH }}/ubuntu-portable/ --verbosity detailed
#
# - name: Zip Linux-x64 artifacts
## if: github.ref == 'refs/heads/master'
# uses: montudor/[email protected]
# with:
# args: zip -qq -r ${{ env.OUTPUT_PATH }}/ADR-CLI-tool-ubuntu-${{ steps.gitversion.outputs.nuGetVersionV2 }}.zip ${{ env.OUTPUT_PATH }}/ubuntu-portable/
#
# - name: Upload a Build Artifact
## if: github.ref == 'refs/heads/master'
# uses: actions/upload-artifact@v2
# with:
# name: ADR-CLI-tool-${{ steps.gitversion.outputs.nuGetVersionV2 }}
# path: ${{ env.OUTPUT_PATH }}
#
# publish_artifacts:
# name: Publish Artifacts
# needs: [publish_linux, publish_windows]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
#
# - name: Upload a Build Artifact
# # if: github.ref == 'refs/heads/master'
# uses: actions/upload-artifact@v2
# with:
# name: ADR-CLI-tool-${{ steps.gitversion.outputs.nuGetVersionV2 }}
# path: ${{ env.OUTPUT_PATH }}