Skip to content

Commit 3272937

Browse files
committed
Fix ci (fingers crossed)
1 parent 0021c05 commit 3272937

10 files changed

Lines changed: 92 additions & 87 deletions

File tree

.github/workflows/release.yaml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,9 @@ jobs:
2727
- name: Setup .NET Workloads
2828
run: dotnet workload install android
2929

30-
- name: Test
31-
run: |
32-
$env:PATH += ";C:/Program Files/Microsoft Visual Studio/2022/Enterprise/Msbuild/Current/Bin";
33-
./restore.ps1 ./tests/Navigation.UnitTests Release
34-
./build.ps1 ./tests/Navigation.UnitTests/ Release
35-
./test.ps1 ./tests/Navigation.UnitTests/ Release
36-
37-
- name: Publish
38-
run: |
39-
$env:PATH += ";C:/Program Files/Microsoft Visual Studio/2022/Enterprise/Msbuild/Current/Bin";
40-
./publish.ps1 ./src/Navigation/
30+
- name: Build, Test, Pack
31+
shell: pwsh
32+
run: ./ci.ps1
4133

4234
- name: Publish to NuGet
4335
env:

Directory.Build.props

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@
99
<!-- Set output paths -->
1010
<SourceDir>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'Directory.Build.props'))</SourceDir>
1111
<ArtifactsDir>$(SourceDir)\artifacts</ArtifactsDir>
12-
<Artifacts>$(ArtifactsDir)\$(MSBuildProjectName)\$(Configuration)</Artifacts>
12+
<Artifacts>$(SourceDir)\artifacts\$(MSBuildProjectName)</Artifacts>
1313

14+
1415
<OutputPath>$(Artifacts)\bin</OutputPath>
1516
<BaseOutputPath>$(Artifacts)\obj</BaseOutputPath>
16-
<PackageOutputPath>$(SourceDir)nuget</PackageOutputPath>
17-
<DocumentationFile>$(ArtifactsDir)\$(MSBuildProjectName)\doc.xml</DocumentationFile>
1817
<BaseIntermediateOutputPath>$(BaseOutputPath)</BaseIntermediateOutputPath>
18+
<PackageOutputPath>$(SourceDir)nuget</PackageOutputPath>
1919
</PropertyGroup>
2020

2121
<PropertyGroup>
2222
<Authors>Panos Athanasiou</Authors>
23-
<Copyright>Copyright (c) 2021 Panos Athanasiou</Copyright>
23+
<Copyright>Copyright (c) 2022 Panos Athanasiou</Copyright>
2424
<PackageLicenseExpression>MIT</PackageLicenseExpression>
2525
<PackageProjectUrl>https://github.com/panoukos41/navigation</PackageProjectUrl>
2626
<PackageIconUrl></PackageIconUrl>

Navigation.sln

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "root", "root", "{2E863483-3
1010
.editorconfig = .editorconfig
1111
.gitattributes = .gitattributes
1212
.gitignore = .gitignore
13-
build.ps1 = build.ps1
13+
ci.ps1 = ci.ps1
1414
Directory.Build.props = Directory.Build.props
1515
global.json = global.json
1616
LICENSE.md = LICENSE.md
17-
publish.ps1 = publish.ps1
1817
README.md = README.md
19-
restore.ps1 = restore.ps1
20-
test.ps1 = test.ps1
2118
version.json = version.json
2219
EndProjectSection
2320
EndProject

build.ps1

Lines changed: 0 additions & 18 deletions
This file was deleted.

ci.ps1

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
[CmdletBinding()]
2+
param (
3+
[Parameter(Position = 0)]
4+
[ValidateSet("build", "test", "pack")]
5+
[string] $command = $null,
6+
7+
[Parameter(Position = 1)]
8+
[ValidateSet("Debug", "Release")]
9+
[string] $configuration = "Release"
10+
)
11+
12+
$env:PATH += ";C:/Program Files/Microsoft Visual Studio/2022/Enterprise/Msbuild/Current/Bin";
13+
14+
$build = @(
15+
"./src/Navigation",
16+
"./tests/Navigation.UnitTests"
17+
)
18+
19+
$test = @(
20+
"./tests/Navigation.UnitTests"
21+
)
22+
23+
$pack = @(
24+
"./src/Navigation"
25+
)
26+
27+
function build () {
28+
foreach ($path in $build) {
29+
msbuild `
30+
/t:"restore,build" `
31+
/nowarn:"MSB4011,VSX1000" `
32+
/p:NoPackageAnalysis=true `
33+
/p:ContinuousIntegrationBuild=true `
34+
/p:Configuration=$configuration `
35+
/verbosity:minimal `
36+
$path
37+
}
38+
}
39+
40+
function test () {
41+
foreach ($path in $test) {
42+
dotnet `
43+
test $path `
44+
-c $configuration `
45+
--no-restore `
46+
--no-build
47+
}
48+
}
49+
50+
function pack () {
51+
$output = "./nuget"
52+
foreach ($path in $pack) {
53+
msbuild `
54+
/t:"pack" `
55+
/nowarn:"MSB4011,VSX1000" `
56+
/p:NoPackageAnalysis=true `
57+
/p:ContinuousIntegrationBuild=true `
58+
/p:Configuration=Release `
59+
/p:PackageOutputPath=$output `
60+
/verbosity:minimal `
61+
$path
62+
}
63+
}
64+
65+
switch ($command.ToString()) {
66+
"build" { build; break }
67+
"test" { test; break }
68+
"pack" { pack; break }
69+
Default {
70+
build;
71+
test;
72+
pack;
73+
}
74+
}

global.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"sdk": {
3-
"version": "7.0.0",
3+
"version": "6.0.0",
44
"rollForward": "latestMinor",
5-
"allowPrerelease": true
5+
"allowPrerelease": false
66
},
77
"msbuild-sdks": {
88
"MSBuild.Sdk.Extras": "3.0.44"

publish.ps1

Lines changed: 0 additions & 14 deletions
This file was deleted.

restore.ps1

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"profiles": {
3+
"WSL": {
4+
"commandName": "WSL2",
5+
"distributionName": ""
6+
}
7+
}
8+
}

test.ps1

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)