Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 6 additions & 18 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,9 @@ concurrency:
jobs:
build:
name: Build and test
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
fetch-tags: true

- name: Setup .NET
uses: actions/setup-dotnet@v6
with:
dotnet-version: "10.0.x"

- name: Run PR pipeline
env:
Build__RunPack: "true"
Build__ValidatePack: "true"
run: dotnet run --project build/PipelineCLI/PipelineCLI.csproj --configuration Release
uses: purview-dev/build/.github/workflows/purview-build.yml@main
with:
build-version: "0.2.1"
run-pack: true
validate-pack: true
secrets: inherit
44 changes: 6 additions & 38 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,9 @@ concurrency:
jobs:
release:
name: Release packages
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: write
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
fetch-tags: true

- name: Setup .NET
uses: actions/setup-dotnet@v6
with:
dotnet-version: "10.0.x"

- name: Check for version bump
id: version
shell: bash
run: |
VERSION=$(node -p "require('./package.json').version")
TAG="v$VERSION"
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "Version $VERSION is already tagged as $TAG. Skipping release."
echo "should_publish=false" >> "$GITHUB_OUTPUT"
else
echo "New version $VERSION detected. Releasing $TAG."
echo "should_publish=true" >> "$GITHUB_OUTPUT"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
fi

- name: Run release pipeline
if: steps.version.outputs.should_publish == 'true'
env:
Release__Mode: NuGet
NuGet__ApiKey: ${{ secrets.NUGET__APIKEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: dotnet run --project build/PipelineCLI/PipelineCLI.csproj --configuration Release
uses: purview-dev/build/.github/workflows/purview-release.yml@main
with:
build-version: "0.2.1"
release-mode: NuGet
release-branch: main
secrets: inherit
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -660,3 +660,5 @@ sketch
BenchmarkDotNet.Artifacts/
!**/Sdk/build
!build/

.tools/
7 changes: 0 additions & 7 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,8 @@
<RoslynCompilerVersion Condition="'$(RoslynCompilerVersion)' == ''">[4.13.0,)</RoslynCompilerVersion>
<RoslynAnalyzersVersion Condition="'$(RoslynAnalyzersVersion)' == ''">[5.9.0,)</RoslynAnalyzersVersion>
<TUnitVersion>[1.65.51,)</TUnitVersion>
<ModularPipelinesVersion>[3.2.8,)</ModularPipelinesVersion>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="ModularPipelines" Version="$(ModularPipelinesVersion)" />
<PackageVersion Include="ModularPipelines.DotNet" Version="$(ModularPipelinesVersion)" />
<PackageVersion Include="ModularPipelines.Git" Version="$(ModularPipelinesVersion)" />
<PackageVersion Include="ModularPipelines.GitHub" Version="$(ModularPipelinesVersion)" />
<PackageVersion Include="NuGet.Packaging" Version="7.9.0" />
<PackageVersion Include="NuGet.Versioning" Version="7.9.0" />
<PackageVersion Include="Bogus" Version="[35.6.5,)" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="[8.0.0,)" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="[10.0.400,)" />
Expand Down
34 changes: 21 additions & 13 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,47 +5,60 @@ solution := root_folder / "SourceGeneratorFramework.slnx"
build_configuration := "Release"
artifacts_folder := "./artifacts"
default_test_filter := "/*/*/*/*/"
pipeline_solution := "build/Pipeline.slnx"
pipeline_project := "build/PipelineCLI/PipelineCLI.csproj"
pipeline_version := "0.2.1"
pipeline_feed := "https://api.nuget.org/v3/index.json"
pipeline_tool := ".tools/purview-build/purview-build"

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

[private]
default:
just --list

# Install the shared Purview.Build tool (authenticated to the Purview-Dev feed) if not present
[private]
ensure-pipeline-tool:
if [ ! -x "{{ pipeline_tool }}" ]; then \
dotnet tool install Purview.Build --tool-path .tools/purview-build --add-source "{{ pipeline_feed }}" --version "{{ pipeline_version }}"; \
fi

# Run the PR pipeline (restore, build, lint, tests)
[group('Pipeline')]
pipeline-pr *args:
just ensure-pipeline-tool
echo "Running PR pipeline..."
dotnet run --project {{ pipeline_project }} --configuration {{ build_configuration }} {{ args }}
"{{ pipeline_tool }}" {{ args }}

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

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

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

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

# Build and test with the specified configuration, defaulting to "Release"
[group('Build and Test')]
Expand Down Expand Up @@ -105,8 +118,3 @@ lint-fix:
[group('Utilities')]
vs:
open {{ solution }}

# Open the solution in Visual Studio/ Registered application
[group('Utilities')]
vs-pipeline:
open {{ pipeline_solution }}
12 changes: 0 additions & 12 deletions build/Directory.Build.props

This file was deleted.

3 changes: 0 additions & 3 deletions build/Directory.Build.targets

This file was deleted.

11 changes: 0 additions & 11 deletions build/Pipeline.slnx

This file was deleted.

11 changes: 0 additions & 11 deletions build/PipelineCLI/GlobalUsings.cs

This file was deleted.

9 changes: 0 additions & 9 deletions build/PipelineCLI/Helpers/DotNetCLIOptions.cs

This file was deleted.

21 changes: 0 additions & 21 deletions build/PipelineCLI/Helpers/PathHelpers.cs

This file was deleted.

39 changes: 0 additions & 39 deletions build/PipelineCLI/Helpers/TestHelpers.cs

This file was deleted.

30 changes: 0 additions & 30 deletions build/PipelineCLI/Modules/BuildModule.cs

This file was deleted.

55 changes: 0 additions & 55 deletions build/PipelineCLI/Modules/CreateGitHubReleaseModule.cs

This file was deleted.

Loading