From 909df49d35430ad87a7082a0a7c10f6de5b5b14e Mon Sep 17 00:00:00 2001 From: OGR-67 Date: Sun, 22 Mar 2026 10:25:13 +0100 Subject: [PATCH 1/3] feat: Add release workflow and changelog configuration for GitHub Actions --- .github/workflows/release.yml | 79 ++++++++++++++++++++++++++++++ cliff.toml | 36 ++++++++++++++ src/AL2DBML.CLI/AL2DBML.CLI.csproj | 1 + 3 files changed, 116 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 cliff.toml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a874f0b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,79 @@ +name: Release + +on: + push: + tags: + - 'v*' + release: + types: [published] + +jobs: + build: + name: Build ${{ matrix.rid }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: windows-latest + rid: win-x64 + artifact: al2dbml.exe + - os: ubuntu-latest + rid: linux-x64 + artifact: al2dbml + - os: macos-latest + rid: osx-arm64 + artifact: al2dbml + + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '10.0.x' + + - name: Publish + run: dotnet publish src/AL2DBML.CLI/AL2DBML.CLI.csproj -c Release -r ${{ matrix.rid }} --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -o publish/${{ matrix.rid }} + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.rid }} + path: publish/${{ matrix.rid }}/${{ matrix.artifact }} + + release: + name: Create GitHub Release + needs: build + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Generate changelog + uses: orhun/git-cliff-action@v4 + with: + args: --latest + id: cliff + + - name: Download all artifacts + uses: actions/download-artifact@v4 + + - name: Rename artifacts + run: | + mv win-x64/al2dbml.exe al2dbml-win-x64.exe + mv linux-x64/al2dbml al2dbml-linux-x64 + mv osx-arm64/al2dbml al2dbml-osx-arm64 + chmod +x al2dbml-linux-x64 al2dbml-osx-arm64 + + - name: Create Release + uses: softprops/action-gh-release@v2 + with: + body: ${{ steps.cliff.outputs.content }} + files: | + al2dbml-win-x64.exe + al2dbml-linux-x64 + al2dbml-osx-arm64 diff --git a/cliff.toml b/cliff.toml new file mode 100644 index 0000000..d92e90d --- /dev/null +++ b/cliff.toml @@ -0,0 +1,36 @@ +[changelog] +header = """ +# Changelog\n +""" +body = """ +{% if version %}\ +## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} +{% else %}\ +## [Unreleased] +{% endif %}\ +{% for group, commits in commits | group_by(attribute="group") %} +### {{ group | striptags | trim | upper_first }} +{% for commit in commits %} +- {{ commit.message | upper_first }}\ +{% endfor %} +{% endfor %}\n +""" +trim = true +footer = "" + +[git] +conventional_commits = true +filter_unconventional = false +commit_parsers = [ + { message = "^feat", group = "Features" }, + { message = "^fix", group = "Bug Fixes" }, + { message = "^refactor", group = "Refactoring" }, + { message = "^test", group = "Testing" }, + { message = "^doc", group = "Documentation" }, + { message = "^perf", group = "Performance" }, + { message = "^chore|^ci", group = "Miscellaneous" }, + { message = ".*", group = "Other" }, +] +filter_commits = false +tag_pattern = "v[0-9]*" +sort_commits = "oldest" diff --git a/src/AL2DBML.CLI/AL2DBML.CLI.csproj b/src/AL2DBML.CLI/AL2DBML.CLI.csproj index 2962959..c0c1d61 100644 --- a/src/AL2DBML.CLI/AL2DBML.CLI.csproj +++ b/src/AL2DBML.CLI/AL2DBML.CLI.csproj @@ -5,6 +5,7 @@ net10.0 enable enable + al2dbml From 5afb86c3f63d9ffe5a5c39a4c9cba9cbe297079b Mon Sep 17 00:00:00 2001 From: OGR-67 Date: Sun, 22 Mar 2026 10:31:21 +0100 Subject: [PATCH 2/3] chore: Update tag patterns for release workflow and changelog configuration --- .github/workflows/release.yml | 4 +--- cliff.toml | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a874f0b..f35c44b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,9 +3,7 @@ name: Release on: push: tags: - - 'v*' - release: - types: [published] + - 'v[0-9]+.[0-9]+.[0-9]+*' jobs: build: diff --git a/cliff.toml b/cliff.toml index d92e90d..806eaeb 100644 --- a/cliff.toml +++ b/cliff.toml @@ -32,5 +32,5 @@ commit_parsers = [ { message = ".*", group = "Other" }, ] filter_commits = false -tag_pattern = "v[0-9]*" +tag_pattern = "v[0-9]+\\.[0-9]+\\.[0-9]+.*" sort_commits = "oldest" From a89c8430cf3e03e2dc922769d06f6dd85bb674a2 Mon Sep 17 00:00:00 2001 From: OGR-67 Date: Sun, 22 Mar 2026 10:34:04 +0100 Subject: [PATCH 3/3] chore: Add workflow_dispatch trigger and update release conditions in GitHub Actions --- .github/workflows/release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f35c44b..f4c8b1c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,7 @@ on: push: tags: - 'v[0-9]+.[0-9]+.[0-9]+*' + workflow_dispatch: jobs: build: @@ -43,6 +44,7 @@ jobs: name: Create GitHub Release needs: build runs-on: ubuntu-latest + if: github.event_name == 'push' permissions: contents: write @@ -71,6 +73,7 @@ jobs: uses: softprops/action-gh-release@v2 with: body: ${{ steps.cliff.outputs.content }} + prerelease: ${{ contains(github.ref_name, '-') }} files: | al2dbml-win-x64.exe al2dbml-linux-x64