Skip to content

Commit 2c6823f

Browse files
Merge pull request #11 from purview-dev/expanding
build: adopt shared Purview.Build pipeline
2 parents 466c1be + 74833cc commit 2c6823f

102 files changed

Lines changed: 4514 additions & 2024 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/pr.yml‎

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,9 @@ concurrency:
1111
jobs:
1212
build:
1313
name: Build and test
14-
runs-on: ubuntu-latest
15-
timeout-minutes: 30
16-
steps:
17-
- uses: actions/checkout@v7
18-
with:
19-
fetch-depth: 0
20-
fetch-tags: true
21-
22-
- name: Setup .NET
23-
uses: actions/setup-dotnet@v6
24-
with:
25-
dotnet-version: "10.0.x"
26-
27-
- name: Run PR pipeline
28-
env:
29-
Build__RunPack: "true"
30-
Build__ValidatePack: "true"
31-
run: dotnet run --project build/PipelineCLI/PipelineCLI.csproj --configuration Release
14+
uses: purview-dev/build/.github/workflows/purview-build.yml@main
15+
with:
16+
build-version: "0.2.1"
17+
run-pack: true
18+
validate-pack: true
19+
secrets: inherit

‎.github/workflows/release.yml‎

Lines changed: 6 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -11,41 +11,9 @@ concurrency:
1111
jobs:
1212
release:
1313
name: Release packages
14-
runs-on: ubuntu-latest
15-
timeout-minutes: 30
16-
permissions:
17-
contents: write
18-
steps:
19-
- uses: actions/checkout@v7
20-
with:
21-
fetch-depth: 0
22-
fetch-tags: true
23-
24-
- name: Setup .NET
25-
uses: actions/setup-dotnet@v6
26-
with:
27-
dotnet-version: "10.0.x"
28-
29-
- name: Check for version bump
30-
id: version
31-
shell: bash
32-
run: |
33-
VERSION=$(node -p "require('./package.json').version")
34-
TAG="v$VERSION"
35-
if git rev-parse "$TAG" >/dev/null 2>&1; then
36-
echo "Version $VERSION is already tagged as $TAG. Skipping release."
37-
echo "should_publish=false" >> "$GITHUB_OUTPUT"
38-
else
39-
echo "New version $VERSION detected. Releasing $TAG."
40-
echo "should_publish=true" >> "$GITHUB_OUTPUT"
41-
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
42-
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
43-
fi
44-
45-
- name: Run release pipeline
46-
if: steps.version.outputs.should_publish == 'true'
47-
env:
48-
Release__Mode: NuGet
49-
NuGet__ApiKey: ${{ secrets.NUGET__APIKEY }}
50-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51-
run: dotnet run --project build/PipelineCLI/PipelineCLI.csproj --configuration Release
14+
uses: purview-dev/build/.github/workflows/purview-release.yml@main
15+
with:
16+
build-version: "0.2.1"
17+
release-mode: NuGet
18+
release-branch: main
19+
secrets: inherit

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,3 +660,5 @@ sketch
660660
BenchmarkDotNet.Artifacts/
661661
!**/Sdk/build
662662
!build/
663+
664+
.tools/

‎Directory.Packages.props‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,8 @@
44
<RoslynCompilerVersion Condition="'$(RoslynCompilerVersion)' == ''">[4.13.0,)</RoslynCompilerVersion>
55
<RoslynAnalyzersVersion Condition="'$(RoslynAnalyzersVersion)' == ''">[5.9.0,)</RoslynAnalyzersVersion>
66
<TUnitVersion>[1.65.51,)</TUnitVersion>
7-
<ModularPipelinesVersion>[3.2.8,)</ModularPipelinesVersion>
87
</PropertyGroup>
98
<ItemGroup>
10-
<PackageVersion Include="ModularPipelines" Version="$(ModularPipelinesVersion)" />
11-
<PackageVersion Include="ModularPipelines.DotNet" Version="$(ModularPipelinesVersion)" />
12-
<PackageVersion Include="ModularPipelines.Git" Version="$(ModularPipelinesVersion)" />
13-
<PackageVersion Include="ModularPipelines.GitHub" Version="$(ModularPipelinesVersion)" />
14-
<PackageVersion Include="NuGet.Packaging" Version="7.9.0" />
15-
<PackageVersion Include="NuGet.Versioning" Version="7.9.0" />
169
<PackageVersion Include="Bogus" Version="[35.6.5,)" />
1710
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="[8.0.0,)" />
1811
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="[10.0.400,)" />

‎Justfile‎

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,47 +5,60 @@ solution := root_folder / "SourceGeneratorFramework.slnx"
55
build_configuration := "Release"
66
artifacts_folder := "./artifacts"
77
default_test_filter := "/*/*/*/*/"
8-
pipeline_solution := "build/Pipeline.slnx"
9-
pipeline_project := "build/PipelineCLI/PipelineCLI.csproj"
8+
pipeline_version := "0.2.1"
9+
pipeline_feed := "https://api.nuget.org/v3/index.json"
10+
pipeline_tool := ".tools/purview-build/purview-build"
1011

1112
current_version := `node -p "require('./package.json').version"`
1213

1314
[private]
1415
default:
1516
just --list
1617

18+
# Install the shared Purview.Build tool (authenticated to the Purview-Dev feed) if not present
19+
[private]
20+
ensure-pipeline-tool:
21+
if [ ! -x "{{ pipeline_tool }}" ]; then \
22+
dotnet tool install Purview.Build --tool-path .tools/purview-build --add-source "{{ pipeline_feed }}" --version "{{ pipeline_version }}"; \
23+
fi
24+
1725
# Run the PR pipeline (restore, build, lint, tests)
1826
[group('Pipeline')]
1927
pipeline-pr *args:
28+
just ensure-pipeline-tool
2029
echo "Running PR pipeline..."
21-
dotnet run --project {{ pipeline_project }} --configuration {{ build_configuration }} {{ args }}
30+
"{{ pipeline_tool }}" {{ args }}
2231

2332
# Run the build pipeline (restore, build, lint)
2433
[group('Pipeline')]
2534
pipeline-build *args:
35+
just ensure-pipeline-tool
2636
echo "Running build pipeline..."
27-
dotnet run --project {{ pipeline_project }} --configuration {{ build_configuration }} -- --Build:RunTests=false --Release:Mode=None {{ args }}
37+
"{{ pipeline_tool }}" --Build:RunTests=false --Release:Mode=None {{ args }}
2838

2939
# Run the release pipeline (restore, build, lint, tests, pack, publish, GitHub release)
3040
[group('Pipeline')]
3141
pipeline-release *args:
42+
just ensure-pipeline-tool
3243
echo "Running release pipeline..."
33-
dotnet run --project {{ pipeline_project }} --configuration {{ build_configuration }} -- --Release:Mode=NuGet {{ args }}
44+
"{{ pipeline_tool }}" --Release:Mode=NuGet {{ args }}
3445

3546
# Run the release pipeline (restore, build, lint, tests, pack, local nuget publish)
3647
# Note: `just` runs recipes through the shell, which strips backslashes from unquoted arguments.
37-
# Always use forward slashes for the feed path, e.g.
48+
# Use the LOCAL_NUGET_FEED_PATH environment variable or forward slashes, e.g.
3849
# just pipeline-local-release --PublishLocalNuGet:LocalFeedPath=p:/_sync-projects/.local-nuget/
3950
[group('Pipeline')]
4051
pipeline-local-release *args:
52+
just ensure-pipeline-tool
4153
echo "Running local release pipeline..."
42-
dotnet run --project {{ pipeline_project }} --configuration {{ build_configuration }} -- --Release:Mode=LocalNuGet {{ args }}
54+
"{{ pipeline_tool }}" --Release:Mode=LocalNuGet {{ args }}
4355

4456
# Run the pipeline with tests enabled
4557
[group('Pipeline')]
4658
pipeline-tests *args:
59+
just ensure-pipeline-tool
4760
echo "Running tests pipeline..."
48-
dotnet run --project {{ pipeline_project }} --configuration {{ build_configuration }} -- --Build:RunTests=true --Release:Mode=None {{ args }}
61+
"{{ pipeline_tool }}" --Build:RunTests=true --Release:Mode=None {{ args }}
4962

5063
# Build and test with the specified configuration, defaulting to "Release"
5164
[group('Build and Test')]
@@ -105,8 +118,3 @@ lint-fix:
105118
[group('Utilities')]
106119
vs:
107120
open {{ solution }}
108-
109-
# Open the solution in Visual Studio/ Registered application
110-
[group('Utilities')]
111-
vs-pipeline:
112-
open {{ pipeline_solution }}

‎build/Directory.Build.props‎

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

‎build/Directory.Build.targets‎

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

‎build/Pipeline.slnx‎

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

‎build/PipelineCLI/GlobalUsings.cs‎

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

‎build/PipelineCLI/Helpers/DotNetCLIOptions.cs‎

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

0 commit comments

Comments
 (0)