Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Release

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
workflow_dispatch:

Comment on lines +3 to +8

Copilot AI Mar 22, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow triggers on both push tags and release: published. For the same version, that can run the pipeline twice and potentially try to recreate/update the same GitHub Release and re-upload assets, causing failures or duplicate work. Consider triggering from only one event (commonly push tags) or gating the release job with an if: so only one path creates/uploads release assets.

Copilot uses AI. Check for mistakes.
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
36 changes: 36 additions & 0 deletions cliff.toml
Original file line number Diff line number Diff line change
@@ -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"
1 change: 1 addition & 0 deletions src/AL2DBML.CLI/AL2DBML.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AssemblyName>al2dbml</AssemblyName>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading