Files
HelperLib/.github/workflows/changelog.yml
T
2026-01-28 13:27:25 +00:00

52 lines
1.9 KiB
YAML
Executable File

name: Create Tag
on:
workflow_dispatch:
inputs:
tagName:
description: 'Tag name:'
type: string
required: true
run-name: "Generating changelog for Release v${{github.event.inputs.tagName}}"
jobs:
generate_changelog:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
token: ${{ secrets.TOKEN }}
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Update OmegaLeo.HelperLib Version
run: sed -i "s/\(<Version>\)[0-9]\+\.[0-9]\+\.[0-9]\+/\1${{github.event.inputs.tagName}}/" "./OmegaLeo.HelperLib/OmegaLeo.HelperLib.csproj"
- name: Update OmegaLeo.HelperLib.Changelog Version
run: sed -i "s/\(<Version>\)[0-9]\+\.[0-9]\+\.[0-9]\+/\1${{github.event.inputs.tagName}}/" "./OmegaLeo.HelperLib.Changelog/OmegaLeo.HelperLib.Changelog.csproj"
- name: Build Solution
run: dotnet build --configuration Release
- name: Run Changelog Generator
run: dotnet run --project "./OmegaLeo.HelperLib.ChangelogHandler/OmegaLeo.HelperLib.ChangelogHandler.csproj" --configuration Release
env:
TAG_VERSION: ${{ github.event.inputs.tagName }}
- name: Commit and Push Changes
run: |
git config --local user.email "nunodiogo@omegaleo.pt"
git config --local user.name "Nuno Diogo"
git add .
git diff --staged --quiet || git commit -m "chore: update changelog and version to v${{github.event.inputs.tagName}}"
git push origin ${{ github.ref }}
- name: Create and Push Tag
run: |
git tag -a "v${{ github.event.inputs.tagName }}" -m "Release v${{ github.event.inputs.tagName }}"
git push origin "v${{ github.event.inputs.tagName }}"