diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..f4c8b1c
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,80 @@
+name: Release
+
+on:
+ push:
+ tags:
+ - 'v[0-9]+.[0-9]+.[0-9]+*'
+ workflow_dispatch:
+
+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
+ if: github.event_name == 'push'
+ 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 }}
+ prerelease: ${{ contains(github.ref_name, '-') }}
+ 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..806eaeb
--- /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]+\\.[0-9]+\\.[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