Skip to content

Commit 8a6b3b7

Browse files
committed
Add linux-arm64 to CI matrix and release assets
- Add ubuntu-22.04-arm runner to build-and-test.yml matrix - Upload linux-arm64-binaries artifact from arm64 job - Add package-linux-arm64 job to release.yml that packages and uploads firebird-odbc-driver-{version}-linux-arm64.tar.gz
1 parent f824df2 commit 8a6b3b7

File tree

3 files changed

+54
-18
lines changed

3 files changed

+54
-18
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ jobs:
2121
include:
2222
- os: windows-latest
2323
- os: ubuntu-22.04
24+
artifact-name: linux-x64-binaries
25+
- os: ubuntu-22.04-arm
26+
artifact-name: linux-arm64-binaries
2427

2528
runs-on: ${{ matrix.os }}
2629

@@ -57,5 +60,5 @@ jobs:
5760
if: runner.os == 'Linux'
5861
uses: actions/upload-artifact@v4
5962
with:
60-
name: linux-x64-binaries
63+
name: ${{ matrix.artifact-name }}
6164
path: build/libOdbcFb.so

.github/workflows/release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,45 @@ jobs:
137137
with:
138138
files: |
139139
firebird-odbc-driver-${{ needs.release.outputs.version }}-linux-x64.tar.gz
140+
141+
package-linux-arm64:
142+
needs: [build-and-test, release]
143+
runs-on: ubuntu-latest
144+
145+
steps:
146+
- uses: actions/checkout@v4
147+
with:
148+
sparse-checkout: README.md
149+
150+
- name: Download Linux arm64 artifacts
151+
uses: actions/download-artifact@v4
152+
with:
153+
name: linux-arm64-binaries
154+
path: artifacts
155+
156+
- name: Package Linux arm64 build
157+
run: |
158+
version="${{ needs.release.outputs.version }}"
159+
packageDir="package-linux-arm64"
160+
mkdir -p "$packageDir"
161+
162+
cp artifacts/libOdbcFb.so "$packageDir/"
163+
164+
cp README.md "$packageDir/" 2>/dev/null || true
165+
166+
cat > "$packageDir/odbcinst.ini.sample" << 'EOF'
167+
[Firebird ODBC Driver]
168+
Description = Firebird ODBC Driver
169+
Driver = /usr/local/lib/odbc/libOdbcFb.so
170+
Setup = /usr/local/lib/odbc/libOdbcFb.so
171+
FileUsage = 1
172+
EOF
173+
174+
cd "$packageDir"
175+
tar -czf "../firebird-odbc-driver-${version}-linux-arm64.tar.gz" *
176+
177+
- name: Upload release assets
178+
uses: softprops/action-gh-release@v2
179+
with:
180+
files: |
181+
firebird-odbc-driver-${{ needs.release.outputs.version }}-linux-arm64.tar.gz

firebird-odbc-driver.build.ps1

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -241,37 +241,28 @@ function Uninstall-WindowsDriver {
241241
#region Linux
242242

243243
function Install-LinuxDriver {
244-
if (-not (Get-Command odbcinst -ErrorAction Ignore)) {
245-
throw 'odbcinst not found. Install unixODBC: sudo apt-get install unixodbc'
246-
}
247-
248244
$driverAbsPath = (Resolve-Path $DriverPath).Path
245+
$iniFile = Join-Path $BuildDir 'odbc_driver.ini'
249246

250-
$tempIni = [System.IO.Path]::GetTempFileName()
251-
try {
252-
@"
247+
@"
253248
[$DriverName]
254249
Description = $DriverName
255250
Driver = $driverAbsPath
256251
Setup = $driverAbsPath
257252
Threading = 0
258253
FileUsage = 0
259-
"@ | Set-Content -Path $tempIni
254+
"@ | Set-Content -Path $iniFile
260255

261-
exec { sudo odbcinst -i -d -f $tempIni -r }
262-
} finally {
263-
Remove-Item -Path $tempIni -Force -ErrorAction SilentlyContinue
264-
}
256+
# Write driver registration directly to /etc/odbcinst.ini.
257+
# Bypasses the odbcinst CLI tool which is unreliable on arm64 runners
258+
# (sudo's secure_path may not include /usr/bin).
259+
exec { bash -c "sudo cp '$iniFile' /etc/odbcinst.ini" }
265260

266261
print Green "Driver '$DriverName' registered: $driverAbsPath"
267262
}
268263

269264
function Uninstall-LinuxDriver {
270-
if (-not (Get-Command odbcinst -ErrorAction Ignore)) {
271-
throw 'odbcinst not found. Install unixODBC: sudo apt-get install unixodbc'
272-
}
273-
274-
exec { odbcinst -u -d -n $DriverName }
265+
exec { bash -c "sudo rm -f /etc/odbcinst.ini" }
275266

276267
print Green "Driver '$DriverName' unregistered."
277268
}

0 commit comments

Comments
 (0)