Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
25 changes: 25 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Blake.Types:
- changed-files:
- any-glob-to-any-file: 'src/Blake.Types/**'

Blake.MarkdownParser:
- changed-files:
- any-glob-to-any-file: 'src/Blake.MarkdownParser/**'

Blake.BuildTools:
- changed-files:
- any-glob-to-any-file: 'src/Blake.BuildTools/**'

Blake.CLI:
- changed-files:
- any-glob-to-any-file: 'src/Blake.CLI/**'

dependencies:
- changed-files:
- any-glob-to-any-file: '**/*.csproj'
- any-glob-to-any-file: '**/Directory.Packages.props'
- any-glob-to-any-file: '**/packages.lock.json'

enhancement:
- changed-files:
- any-glob-to-any-file: 'src/**'
18 changes: 18 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Summary

<!-- Describe the change -->

---

🧷 This PR will be released as a **preview** by default.

To trigger a **stable release**:

- Remove the `preview` label
- Add the `release` label
- Optionally add `Semver-Minor` or `Semver-Major` to control version bump

🏷️ Add labels to control release notes:

- `enhancement`, `bug`, `breaking-change`, `dependencies`
- Or use `ignore-for-release` to suppress it from notes
30 changes: 30 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
changelog:
exclude:
labels:
- ignore-for-release
authors:
- dependabot
- github-actions

categories:
- title: 🛠 Breaking Changes
labels:
- breaking-change
- Semver-Major

- title: 🎉 Features
labels:
- enhancement
- Semver-Minor

- title: 🐛 Bug Fixes
labels:
- bug

- title: 👒 Dependency Updates
labels:
- dependencies

- title: 📦 Other Changes
labels:
- '*'
92 changes: 92 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: ci

on:
push:
branches: [main]
paths:
- 'src/**'
workflow_dispatch:

jobs:

generate-version:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v4

- name: Get last merged PR labels
id: prlabels
run: |
PR=$(gh pr list --state merged --base main --limit 1 --json number --jq '.[0].number')
LABELS=$(gh pr view $PR --json labels --jq '[.labels[].name]')
echo "PR_NUMBER=$PR" >> $GITHUB_ENV
echo "LABELS=$LABELS" >> $GITHUB_ENV

# Fail if both preview and release are set
if [[ "$LABELS" == *"preview"* && "$LABELS" == *"release"* ]]; then
echo "❌ Both 'preview' and 'release' labels present. Only one allowed."
exit 1
fi

# Fail if neither preview nor release is set
if [[ "$LABELS" != *"preview"* && "$LABELS" != *"release"* ]]; then
echo "❌ PR must have either 'preview' or 'release' label."
exit 1
fi

# Set PRERELEASE
if [[ "$LABELS" == *"preview"* ]]; then
echo "PRERELEASE=true" >> $GITHUB_ENV
else
echo "PRERELEASE=false" >> $GITHUB_ENV
fi

# Set bump type
if [[ "$LABELS" == *"Semver-Major"* ]]; then
echo "BUMP=major" >> $GITHUB_ENV
elif [[ "$LABELS" == *"Semver-Minor"* ]]; then
echo "BUMP=minor" >> $GITHUB_ENV
else
echo "BUMP=patch" >> $GITHUB_ENV
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}


- name: GitHub Tag Bump
id: tag_bump
uses: anothrNick/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
INITIAL_VERSION: 1.0.0
DEFAULT_BUMP: ${{ env.BUMP }}
PRERELEASE: ${{ env.PRERELEASE }}
PRERELEASE_SUFFIX: 'preview'

outputs:
new_version: ${{ steps.tag_bump.outputs.new_tag }}

publish:
needs: generate-version
runs-on: ubuntu-latest
strategy:
matrix:
project:
- name: Blake.Types
path: src/Blake.Types/Blake.Types.csproj
- name: Blake.MarkdownParser
path: src/Blake.MarkdownParser/Blake.MarkdownParser.csproj
- name: Blake.BuildTools
path: src/Blake.BuildTools/Blake.BuildTools.csproj
- name: Blake.CLI
path: src/Blake.CLI/Blake.CLI.csproj
steps:
- name: Publish
uses: ./.github/workflows/reusable-publish.yml
Copy link

Copilot AI Jul 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow is attempting to call a reusable workflow using a local path, but this syntax is incorrect. Reusable workflows should be called using the 'uses' keyword with the repository and workflow path format, like 'uses: ./.github/workflows/reusable-publish.yml@main' or by moving this to a separate job that calls the reusable workflow properly.

Suggested change
uses: ./.github/workflows/reusable-publish.yml
uses: ./.github/workflows/reusable-publish.yml@main

Copilot uses AI. Check for mistakes.
with:
project_path: ${{ matrix.project.path }}
version: ${{ needs.generate-version.outputs.new_version }}
nuget_key: ${{ secrets.NUGET_API_KEY }}
20 changes: 20 additions & 0 deletions .github/workflows/pr-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Label PRs

on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]

jobs:
add-default-preview-label:
runs-on: ubuntu-latest
steps:
- name: Add 'preview' label
uses: actions-ecosystem/action-add-labels@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: preview

- name: Apply content-based labels from labeler.yml
uses: actions/labeler@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
39 changes: 39 additions & 0 deletions .github/workflows/reusable-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build and publish package

on:
workflow_call:
inputs:
project_path:
description: 'Path to the .csproj file'
type: string
required: true
version:
description: 'Version to use for packaging'
type: string
required: true
nuget_key:
description: 'NuGet API key'
type: string
required: true

jobs:
package-and-publish-lib:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x

- name: Generate NuGet package
run: |
dotnet pack ${{ inputs.project_path }} \
--configuration Release \
-p:PackageVersion=${{ inputs.version }} \
-o packages

- name: Publish NuGet package
run: dotnet nuget push packages/*.nupkg --api-key ${{ inputs.nuget_key }} --source https://api.nuget.org/v3/index.json
Binary file added assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 19 additions & 14 deletions src/Blake.BuildTools/Blake.BuildTools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,33 @@
<RepositoryUrl>https://github.com/matt-goldman/Blake</RepositoryUrl>
<PackageTags>blazor; ssg; razor;</PackageTags>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageIcon>icon.png</PackageIcon>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\LICENSE">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
<ItemGroup>
<None Include="..\..\assets\icon.png" Pack="true" PackagePath="" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\LICENSE">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' == 'Debug'">
<ProjectReference Include="..\Blake.MarkdownParser\Blake.MarkdownParser.csproj" />
<ProjectReference Include="..\Blake.Types\Blake.Types.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' == 'Release'">
<PackageReference Include="Blake.MarkdownParser" Version="*" />
<PackageReference Include="Blake.Types" Version="*" />
<PackageReference Include="Blake.MarkdownParser" Version="*-*" />
<PackageReference Include="Blake.Types" Version="*-*" />
</ItemGroup>

<ItemGroup>
Expand Down
25 changes: 15 additions & 10 deletions src/Blake.CLI/Blake.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,31 @@
<RepositoryUrl>https://github.com/matt-goldman/Blake</RepositoryUrl>
<PackageTags>blazor; ssg; razor;</PackageTags>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageIcon>icon.png</PackageIcon>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\assets\icon.png" Pack="true" PackagePath="" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\LICENSE">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\..\LICENSE">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' == 'Debug'">
<ProjectReference Include="..\Blake.BuildTools\Blake.BuildTools.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' == 'Release'">
<PackageReference Include="Blake.BuildTools" Version="*" />
<PackageReference Include="Blake.BuildTools" Version="*-*" />
</ItemGroup>

<ItemGroup>
Expand Down
20 changes: 19 additions & 1 deletion src/Blake.MarkdownParser/Blake.MarkdownParser.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,25 @@
<Copyright>Matt Goldman 2025</Copyright>
<PackageProjectUrl>https://github.com/matt-goldman/blake</PackageProjectUrl>
<Version>1.0.0</Version>
</PropertyGroup>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageIcon>icon.png</PackageIcon>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\assets\icon.png" Pack="true" PackagePath="" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\LICENSE">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Markdig" Version="0.40.0" />
Expand Down
10 changes: 9 additions & 1 deletion src/Blake.Types/Blake.Types.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
<PackageTags>blazor; ssg; razor;</PackageTags>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
<PackageIcon>icon.png</PackageIcon>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\assets\icon.png" Pack="true" PackagePath="" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\LICENSE">
Expand All @@ -30,4 +35,7 @@
</None>
</ItemGroup>




</Project>
Loading