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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
submodules: true # tests/JSON-Schema-Test-Suite

- name: Install Dotnet
uses: actions/setup-dotnet@9a946fdbd5fb07b82b2f5a4466058b876ab72bb2 # v5.3.0
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
global-json-file: global.json

Expand Down
108 changes: 54 additions & 54 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
# On pushing a tag like v0.1.0, publish to nuget.org and create a GitHub release.
# Use publish-release.ps1 to push a release.
name: release

on:
push:
tags:
- "v[0-9]+.*" # not a regex! ".*" means a period followed by any character https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet

permissions:
contents: write # needed to create the GitHub release

jobs:
build:

runs-on: windows-latest

steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3

- name: Install Dotnet
uses: actions/setup-dotnet@9a946fdbd5fb07b82b2f5a4466058b876ab72bb2 # v5.3.0
with:
global-json-file: global.json

- name: Dotnet Installation Info
run: dotnet --info

- name: Pack
run: dotnet pack ./src/JsonSchemaObjectModel/JsonSchemaObjectModel.csproj -c Release -p:ContinuousIntegrationBuild=true

- name: Publish to NuGet
run: dotnet nuget push --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }} --source 'https://api.nuget.org/v3/index.json' .\src\JsonSchemaObjectModel\bin\Release\JsonSchemaObjectModel.*.nupkg

# Pull the notes for this version straight out of CHANGELOG.md so the GitHub release
# mirrors what's already curated there (CHANGELOG.md is the single source of truth).
- name: Extract release notes from CHANGELOG
shell: pwsh
run: |
$version = '${{ github.ref_name }}'.TrimStart('v')
$changelog = Get-Content -Raw CHANGELOG.md
$escaped = [regex]::Escape($version)
$match = [regex]::Match($changelog, "(?ms)^# Release $escaped[ \t]*\r?\n(.*?)(?=\r?\n# Release |\z)")
if (-not $match.Success) {
Write-Error "Could not find a '# Release $version' section in CHANGELOG.md"
exit 1
}
Set-Content -Path release-notes.md -Value $match.Groups[1].Value.Trim()

- name: Create GitHub release
shell: pwsh
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create "${{ github.ref_name }}" --title "${{ github.ref_name }}" --notes-file release-notes.md --verify-tag
# On pushing a tag like v0.1.0, publish to nuget.org and create a GitHub release.
# Use publish-release.ps1 to push a release.
name: release
on:
push:
tags:
- "v[0-9]+.*" # not a regex! ".*" means a period followed by any character https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
permissions:
contents: write # needed to create the GitHub release
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Install Dotnet
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
global-json-file: global.json
- name: Dotnet Installation Info
run: dotnet --info
- name: Pack
run: dotnet pack ./src/JsonSchemaObjectModel/JsonSchemaObjectModel.csproj -c Release -p:ContinuousIntegrationBuild=true
- name: Publish to NuGet
run: dotnet nuget push --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }} --source 'https://api.nuget.org/v3/index.json' .\src\JsonSchemaObjectModel\bin\Release\JsonSchemaObjectModel.*.nupkg
# Pull the notes for this version straight out of CHANGELOG.md so the GitHub release
# mirrors what's already curated there (CHANGELOG.md is the single source of truth).
- name: Extract release notes from CHANGELOG
shell: pwsh
run: |
$version = '${{ github.ref_name }}'.TrimStart('v')
$changelog = Get-Content -Raw CHANGELOG.md
$escaped = [regex]::Escape($version)
$match = [regex]::Match($changelog, "(?ms)^# Release $escaped[ \t]*\r?\n(.*?)(?=\r?\n# Release |\z)")
if (-not $match.Success) {
Write-Error "Could not find a '# Release $version' section in CHANGELOG.md"
exit 1
}
Set-Content -Path release-notes.md -Value $match.Groups[1].Value.Trim()
- name: Create GitHub release
shell: pwsh
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create "${{ github.ref_name }}" --title "${{ github.ref_name }}" --notes-file release-notes.md --verify-tag
Loading