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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Create Release PR
name: Bump Version

on:
workflow_dispatch
Expand All @@ -15,25 +15,26 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Calculate next version
id: version
shell: pwsh
run: |
$newVer = .\tools\get-next-main-version.ps1
echo "NEW_VERSION=$newVer" >> $env:GITHUB_ENV

.\tools\set-version.ps1 $newVer -UpdateAssemblyAndFileVersion

git config user.name "github-actions"
git config user.email "github-actions@github.com"

git commit -am "Release $newVer"
git commit -am "Bump version to $newVer"

- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
branch: release/${{ env.NEW_VERSION }}
branch: bump/${{ env.NEW_VERSION }}
base: master
title: "Release ${{ env.NEW_VERSION }}"
body: "Automated release PR."
delete-branch: true
title: "Bump version to ${{ env.NEW_VERSION }}"
body: "Automated version bump after release."
merge-method: rebase
14 changes: 14 additions & 0 deletions .github/workflows/publish_nuget.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This listens for the release tag on master, once detected it builds the package, runs tests, and publishes to NuGet, it also creates a GitHub release and triggers the version bump workflow.
# The version bump generates a new PR to increment the version number in the csproj files.
name: Publish

on:
Expand All @@ -8,6 +10,7 @@ on:
permissions:
contents: write
packages: write
actions: write

jobs:
build_and_publish:
Expand Down Expand Up @@ -51,3 +54,14 @@ jobs:
tag_name: ${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Trigger version bump workflow
uses: actions/github-script@v7
with:
script: |
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'bump_version.yml',
ref: 'master'
})
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This workflow tags the current commit as the release and pushes that tag to master, this feeds into the publish_nuget.yml action which looks for the new tag to trigger the release.
# AI code.
name: Release

on:
workflow_dispatch

permissions:
contents: write

jobs:
tag_release:
runs-on: windows-2022

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get current version
id: version
shell: pwsh
run: |
$version = (Select-String -Path tools/UglyToad.PdfPig.Package/UglyToad.PdfPig.Package.csproj -Pattern "<Version>(.*)</Version>").Matches.Groups[1].Value
echo "VERSION=$version" >> $env:GITHUB_ENV

- name: Create annotated tag
shell: pwsh
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"

git tag -a "v${{ env.VERSION }}" -m "Release ${{ env.VERSION }}"
git push origin "v${{ env.VERSION }}"
43 changes: 0 additions & 43 deletions .github/workflows/tag_release.yml

This file was deleted.

Loading