Added new Changelog generator

This commit is contained in:
2025-02-18 21:08:16 +00:00
parent 1443ddda68
commit ac4862a6b3
15 changed files with 265 additions and 1 deletions
+44
View File
@@ -0,0 +1,44 @@
name: Create Tag
on:
workflow_dispatch:
inputs:
tagName:
description: 'Tag name:'
type: string
required: true
jobs:
generate_changelog:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.TOKEN }}
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0.x'
- name: Update Project Versions
run: sed -i "s/\(<Version>\([0-9]\+\.\)\{2\}\)\([0-9]\+\)/\1${{github.event.inputs.tagName}}/" "./OmegaLeo.HelperLib/OmegaLeo.HelperLib.csproj"
- name: Update Project Versions
run: sed -i "s/\(<Version>\([0-9]\+\.\)\{2\}\)\([0-9]\+\)/\1${{github.event.inputs.tagName}}/" "./OmegaLeo.HelperLib.Changelog/OmegaLeo.HelperLib.Changelog.csproj"
- name: Build and Run Changelog Generator
run: dotnet run --project "./OmegaLeo.HelperLib.ChangelogHandler/OmegaLeo.HelperLib.ChangelogHandler.csproj"
env:
UNITYFLOW_SECRET: ${{ secrets.TOKEN }}
- name: Create Tag
run: |
git config --local user.email "nunodiogo@omegaleo.pt"
git config --local user.name "Nuno Diogo"
git add .
git commit -m "Automatically generated changelog for v${{github.event.inputs.tagName}}"
git tag -a "${{ github.event.inputs.tagName }}" -m "Release ${{ github.event.inputs.tagName }}"
git push origin "${{ github.event.inputs.tagName }}"
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: '${{ github.event.inputs.tagName }}'
release_name: 'Release v${{ github.event.inputs.tagName }}'
+25 -1
View File
@@ -16,7 +16,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
outputs:
upload_url: ${{ steps.get_release.outputs.upload_url }}
publish_doc_helper:
publish-helper-lib:
runs-on: ubuntu-latest
needs: [get-release]
steps:
@@ -40,3 +40,27 @@ jobs:
asset_path: ./OmegaLeo.HelperLib/bin/Release/OmegaLeo.HelperLib.${{ github.event.release.tag_name }}.nupkg
asset_name: OmegaLeo.HelperLib.${{ github.event.release.tag_name }}.nupkg
asset_content_type: application/zip
publish-changelog-lib:
runs-on: ubuntu-latest
needs: [ get-release ]
steps:
- uses: actions/checkout@v2
- name: Setup .Net Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0.x'
- name: Update Project Version
run: sed -i "s/\(<Version>\([0-9]\+\.\)\{2\}\)\([0-9]\+\)/\1${{ github.event.release.tag_name }}/" "./OmegaLeo.HelperLib/OmegaLeo.HelperLib.Changelog.csproj"
- name: Create Nuget Package
run: dotnet pack "./OmegaLeo.HelperLib.Changelog/OmegaLeo.HelperLib.Changelog.csproj" -c Release /p:Version=${{ github.event.release.tag_name }} /p:PackageReleaseNotes="See https://github.com/omegaleo/OmegaLeo.HelperLib/releases/tag/${{ github.event.release.tag_name }}"
- name: Publish Nuget Package
run: dotnet nuget push ./OmegaLeo.HelperLib.Changelog/bin/Release/OmegaLeo.HelperLib.Changelog.${{ github.event.release.tag_name }}.nupkg --api-key ${{ secrets.nuget_api_key }} --source https://api.nuget.org/v3/index.json --skip-duplicate
- name: Upload assets to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
upload_url: ${{ needs.get-release.outputs.upload_url }}
asset_path: ./OmegaLeo.HelperLib/bin/Release/OmegaLeo.HelperLib.Changelog.${{ github.event.release.tag_name }}.nupkg
asset_name: OmegaLeo.HelperLib.Changelog.${{ github.event.release.tag_name }}.nupkg
asset_content_type: application/zip