Repository navigation
193 lines (177 loc) · 6.99 KB
/
Copy pathrelease.yml
File metadata and controls
193 lines (177 loc) · 6.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# SPDX-FileCopyrightText: © 2026 Peter Lemenkov and the SeerODBC contributors
# SPDX-License-Identifier: CC0-1.0
name: Release
on:
# A manual run (Actions -> Release -> Run workflow) is a dry run: it builds
# and tests everything a release would, and keeps the artifacts on the run,
# but creates no Release. Use it before tagging.
workflow_dispatch:
push:
tags:
# Unprefixed x.y.z only. AGENTS.md ("Tag naming") requires bare tags
# because the Fedora spec's Source: URL is built from a bare %{version};
# a v-prefixed tag would ship a broken tarball URL, so we deliberately do
# NOT match it here.
- '[0-9]+.[0-9]+.[0-9]+'
permissions:
contents: read
jobs:
# The Windows builds (MSYS2 MINGW64 and MINGW32): seerodbc.dll and what it
# needs, as a zip per architecture (packaging/windows/make-zip.sh), handed to
# the release job.
windows:
name: Windows zip (${{ matrix.arch }})
runs-on: windows-latest
timeout-minutes: 25
strategy:
matrix:
include:
- msystem: MINGW64
pkg: mingw-w64-x86_64
arch: x64
- msystem: MINGW32 # for 32-bit applications (#62)
pkg: mingw-w64-i686
arch: x86
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v7
- name: Set up MSYS2 / MinGW-w64
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
update: true
install: >-
${{ matrix.pkg }}-gcc
${{ matrix.pkg }}-meson
${{ matrix.pkg }}-ninja
${{ matrix.pkg }}-pkgconf
${{ matrix.pkg }}-openssl
${{ matrix.pkg }}-libiconv
zip
- name: Configure
run: meson setup build --buildtype=release
- name: Compile
run: meson compile -C build
- name: Unit tests
run: meson test -C build --print-errorlogs
- name: Package
run: packaging/windows/make-zip.sh build dist
- uses: actions/upload-artifact@v7
with:
name: windows-${{ matrix.arch }}
path: dist/*.zip
# The Windows installer: one setup.exe carrying both drivers
# (packaging/windows/seerodbc.nsi), built on Linux with Fedora's NSIS from
# the zips above. Built only here, for a tag or a dry run - not per PR.
installer:
name: Windows installer
needs: [windows]
runs-on: ubuntu-latest
container: fedora:44
timeout-minutes: 15
steps:
- name: Install NSIS
run: dnf -y install mingw32-nsis unzip
- uses: actions/checkout@v7
- name: Fetch the Windows zips
uses: actions/download-artifact@v8
with:
pattern: windows-*
merge-multiple: true
path: zips
- name: Build the installer
run: packaging/windows/make-installer.sh zips/*-windows-x64.zip zips/*-windows-x86.zip dist
- uses: actions/upload-artifact@v7
with:
name: windows-installer
path: dist/*.exe
release:
name: Build and create the GitHub Release
needs: [windows, installer]
runs-on: ubuntu-latest
permissions:
contents: write # required by `gh release create`
steps:
- uses: actions/checkout@v7
with:
# Full history so the auto-generated notes can reach the previous
# tag for the "Full Changelog" diff link.
fetch-depth: 0
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
meson ninja-build pkg-config libssl-dev unixodbc-dev
- name: Configure
run: meson setup build
- name: Verify the tag matches the meson project version
if: github.event_name == 'push'
# Enforces the version sync AGENTS.md requires: a release tag must equal
# the version bumped in meson.build (which is kept in lockstep with
# include/seer/seertns.h and packaging/seerodbc.spec). Catches a tag
# pushed without the version bump — or vice versa.
run: |
ver=$(meson introspect build --projectinfo | jq -r .version)
if [ "$ver" != "${GITHUB_REF_NAME}" ]; then
echo "::error::tag ${GITHUB_REF_NAME} != meson project version ${ver}" \
"(see AGENTS.md: the three version locations must stay in sync)"
exit 1
fi
- name: Compile
run: meson compile -C build
- name: Offline unit tests
# Gate the release on the offline-safe suite. The live meson tests
# self-gate (exit 77 = skip) without SEER_TEST_*, so this exercises only
# the protocol-core + ODBC-shim unit tests — no Oracle needed. The live
# matrix is the maintainer's pre-tag step (tests/odbc/run-matrix.sh).
run: meson test -C build --print-errorlogs
- name: Build the source distribution
# `meson dist` produces a reproducible git-archived source tarball and
# re-builds + re-tests it in isolation — a build-from-tarball smoke test
# of exactly what downstream packagers consume. Output lands in
# build/meson-dist/ (a .tar.xz plus its .sha256sum).
run: meson dist -C build
- name: Check the curated release notes
if: github.event_name == 'push'
# The Release body is the in-tree docs/releases/<tag>.md, written in the
# release PR (AGENTS.md step 3). Refuse to publish a release without it
# rather than fall back to the bare PR list.
run: |
notes="docs/releases/${GITHUB_REF_NAME}.md"
if [ ! -s "$notes" ]; then
echo "::error::missing release notes ${notes} (see AGENTS.md, Cutting a release)"
exit 1
fi
- name: Fetch the Windows zips and installer
uses: actions/download-artifact@v8
with:
pattern: windows-*
merge-multiple: true
path: build/windows
- name: Keep a dry run's artifacts
if: github.event_name != 'push'
uses: actions/upload-artifact@v7
with:
name: release-dry-run
path: |
build/meson-dist/*
build/windows/*.zip
build/windows/*.exe
- name: Create GitHub Release
if: github.event_name == 'push'
env:
GH_TOKEN: ${{ github.token }}
run: |
# The body is the curated notes file, then (`--generate-notes`, which
# gh appends after --notes-file) GitHub's standard auto-generated summary:
# "What's Changed" (PRs since the previous tag), "New Contributors" and
# a "Full Changelog" link — the same as the "Generate release notes"
# button in the UI. `--verify-tag` refuses to release a nonexistent tag.
gh release create "${GITHUB_REF_NAME}" \
--title "SeerODBC ${GITHUB_REF_NAME}" \
--notes-file "docs/releases/${GITHUB_REF_NAME}.md" \
--generate-notes \
--verify-tag \
build/meson-dist/* build/windows/*.zip build/windows/*.exe