Skip to content

Commit 24dfc9d

Browse files
committed
Replace InnoSetup with WiX MSI installer, adopt semantic versioning, add release workflow
- Add WiX v4 installer (installer/Product.wxs) for x64 ODBC driver registration - Support Debug builds with alternate driver name for side-by-side install - Add release.yml workflow: triggered on v* tags, creates GitHub Release with MSI, ZIP (Windows) and tar.gz (Linux) assets; detects pre-release tags - Update build-and-test.yml: add workflow_call trigger, run on all branches, use consistent artifact names (windows-x64-binaries, linux-x64-binaries) - Update GetVersionFromGit.cmake to handle pre-release tags (e.g. v3.5.0-rc1) - Update SetupAttributes.h to use Version.h instead of WriteBuildNo.h - Remove old InnoSetup installer (Install/Win32/) - Remove old msbuild.yml and msbuild_arm64.yaml workflows - Remove WriteBuildNo.h (version now comes entirely from git tags)
1 parent 595ba16 commit 24dfc9d

15 files changed

Lines changed: 231 additions & 787 deletions

.github/workflows/build-and-test.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ name: Build and Test
22

33
on:
44
push:
5-
branches: [master]
5+
# Run on all branches, but not on tags (release.yml handles tags)
6+
branches:
7+
- '**'
68
pull_request:
7-
branches: [master]
9+
workflow_call:
810

911
permissions:
1012
contents: read
@@ -37,16 +39,19 @@ jobs:
3739
shell: pwsh
3840
run: Invoke-Build test -Configuration Release -File ./firebird-odbc-driver.build.ps1
3941

40-
- name: Upload driver (Windows)
42+
- name: Upload artifacts (Windows)
4143
if: runner.os == 'Windows'
4244
uses: actions/upload-artifact@v4
4345
with:
44-
name: FirebirdODBC-windows-x64
45-
path: build/Release/FirebirdODBC.dll
46+
name: windows-x64-binaries
47+
path: |
48+
build/Release/FirebirdODBC.dll
49+
build/Release/FirebirdODBC.lib
50+
build/Release/FirebirdODBC.pdb
4651
47-
- name: Upload driver (Linux)
52+
- name: Upload artifacts (Linux)
4853
if: runner.os == 'Linux'
4954
uses: actions/upload-artifact@v4
5055
with:
51-
name: FirebirdODBC-linux-x64
56+
name: linux-x64-binaries
5257
path: build/libOdbcFb.so

.github/workflows/msbuild.yml

Lines changed: 0 additions & 116 deletions
This file was deleted.

.github/workflows/msbuild_arm64.yaml

Lines changed: 0 additions & 96 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build-and-test:
13+
uses: ./.github/workflows/build-and-test.yml
14+
15+
release:
16+
needs: build-and-test
17+
runs-on: ubuntu-latest
18+
outputs:
19+
version: ${{ steps.get_version.outputs.version }}
20+
steps:
21+
- name: Get version from tag
22+
id: get_version
23+
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
24+
25+
- name: Detect prerelease
26+
id: detect_prerelease
27+
run: |
28+
if [[ "${{ github.ref }}" =~ -[a-zA-Z] ]]; then
29+
echo "is_prerelease=true" >> $GITHUB_OUTPUT
30+
else
31+
echo "is_prerelease=false" >> $GITHUB_OUTPUT
32+
fi
33+
34+
- name: Create GitHub Release
35+
uses: softprops/action-gh-release@v2
36+
with:
37+
name: Firebird ODBC Driver v${{ steps.get_version.outputs.version }}
38+
draft: false
39+
prerelease: ${{ steps.detect_prerelease.outputs.is_prerelease }}
40+
generate_release_notes: true
41+
42+
package-windows:
43+
needs: [build-and-test, release]
44+
runs-on: windows-latest
45+
46+
steps:
47+
- uses: actions/checkout@v4
48+
with:
49+
sparse-checkout: |
50+
installer
51+
README.md
52+
53+
- name: Download Windows artifacts
54+
uses: actions/download-artifact@v4
55+
with:
56+
name: windows-x64-binaries
57+
path: artifacts
58+
59+
- name: Install WiX Toolset
60+
run: dotnet tool install --global wix
61+
62+
- name: Build MSI installer
63+
shell: pwsh
64+
run: |
65+
$version = "${{ needs.release.outputs.version }}"
66+
# MSI ProductVersion requires exactly 3 or 4 numeric parts — strip any prerelease suffix
67+
$msiVersion = ($version -replace '-.*', '') + '.0'
68+
$dllPath = Resolve-Path "artifacts/FirebirdODBC.dll"
69+
70+
wix build `
71+
-d ProductVersion=$msiVersion `
72+
-d DriverPath="$dllPath" `
73+
-d Configuration=Release `
74+
-arch x64 `
75+
-o "firebird-odbc-driver-$version-win-x64.msi" `
76+
installer/Product.wxs
77+
78+
- name: Package Windows ZIP
79+
shell: pwsh
80+
run: |
81+
$version = "${{ needs.release.outputs.version }}"
82+
$packageDir = "package-windows"
83+
New-Item -ItemType Directory -Path $packageDir -Force | Out-Null
84+
85+
Copy-Item "artifacts/FirebirdODBC.dll" -Destination $packageDir
86+
Copy-Item "artifacts/FirebirdODBC.lib" -Destination $packageDir -ErrorAction SilentlyContinue
87+
Copy-Item "README.md" -Destination $packageDir -ErrorAction SilentlyContinue
88+
89+
Compress-Archive -Path "$packageDir/*" `
90+
-DestinationPath "firebird-odbc-driver-$version-win-x64.zip"
91+
92+
- name: Upload release assets
93+
uses: softprops/action-gh-release@v2
94+
with:
95+
files: |
96+
firebird-odbc-driver-${{ needs.release.outputs.version }}-win-x64.msi
97+
firebird-odbc-driver-${{ needs.release.outputs.version }}-win-x64.zip
98+
99+
package-linux:
100+
needs: [build-and-test, release]
101+
runs-on: ubuntu-latest
102+
103+
steps:
104+
- uses: actions/checkout@v4
105+
with:
106+
sparse-checkout: README.md
107+
108+
- name: Download Linux artifacts
109+
uses: actions/download-artifact@v4
110+
with:
111+
name: linux-x64-binaries
112+
path: artifacts
113+
114+
- name: Package Linux build
115+
run: |
116+
version="${{ needs.release.outputs.version }}"
117+
packageDir="package-linux"
118+
mkdir -p "$packageDir"
119+
120+
cp artifacts/libOdbcFb.so "$packageDir/"
121+
122+
cp README.md "$packageDir/" 2>/dev/null || true
123+
124+
cat > "$packageDir/odbcinst.ini.sample" << 'EOF'
125+
[Firebird ODBC Driver]
126+
Description = Firebird ODBC Driver
127+
Driver = /usr/local/lib/odbc/libOdbcFb.so
128+
Setup = /usr/local/lib/odbc/libOdbcFb.so
129+
FileUsage = 1
130+
EOF
131+
132+
cd "$packageDir"
133+
tar -czf "../firebird-odbc-driver-${version}-linux-x64.tar.gz" *
134+
135+
- name: Upload release assets
136+
uses: softprops/action-gh-release@v2
137+
with:
138+
files: |
139+
firebird-odbc-driver-${{ needs.release.outputs.version }}-linux-x64.tar.gz

0 commit comments

Comments
 (0)