Skip to content

Update ReleaseNote.md #50

Update ReleaseNote.md

Update ReleaseNote.md #50

Workflow file for this run

name: prs-build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: windows-latest
env:
Solution_Name: PRS.sln
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install .NET 8.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Restore and build the application
run: |
dotnet restore
dotnet build -c Release --no-restore
- name: Increase revision number
id: update_version
shell: pwsh
run: |
$xml_file = "./src/prs.csproj"
$package_version = (Select-String -Path $xml_file -Pattern '<PackageVersion>(.*?)<\/PackageVersion>' -AllMatches).Matches.Groups[1].Value
Write-Host "Current PackageVersion: $package_version"
$version_parts = $package_version -split '\.'
$pmajor, $pminor, $pbuild, $prevision = $version_parts
$prevision = [int]$prevision + 1
$new_package_version = "$pmajor.$pminor.$pbuild.$prevision"
Write-Host "New PackageVersion: $new_package_version"
(Get-Content $xml_file) -replace '<PackageVersion>.*<\/PackageVersion>', "<PackageVersion>$new_package_version</PackageVersion>" | Set-Content $xml_file
echo "branch_name=update-package-version-$prevision" >> $env:GITHUB_ENV
echo "new_package_version=$new_package_version" >> $env:GITHUB_ENV
- name: Create Temporary Branch
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH_NAME: ${{ env.branch_name }}
NEW_PACKAGE_VERSION: ${{ env.new_package_version }}
shell: pwsh
run: |
git config user.name "prs"
git config user.email "prs@example.com"
git checkout -b $env:branch_name
git add .
git commit -m "Update revision number to $env:new_package_version"
git push origin $env:branch_name
- name: Merge Temporary Branch
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH_NAME: ${{ env.branch_name }}
shell: pwsh
run: |
gh auth setup-git
gh pr create --title "Update revision number" --body "Automated update of PackageVersion" --base main --head $env:branch_name
gh pr merge --auto --merge --delete-branch