Skip to content

Commit 262c39a

Browse files
committed
Add release workflow for automated Cygwin binary distribution
Upstream PR abseil#2012 has stalled, so the fork needs to distribute independently. This workflow replicates the manual release process: vendor GoogleTest 1.16.0, build Abseil with external GTest, patch abslConfig.cmake, and publish a tarball with SHA-256 checksums. Triggered on tag push matching *-cygwin (e.g. 20250512.1-cygwin). Full test suite must pass before any artifacts are published.
1 parent 986d4f5 commit 262c39a

1 file changed

Lines changed: 173 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
name: Release (Cygwin)
2+
3+
on:
4+
push:
5+
tags: ['*-cygwin']
6+
7+
permissions:
8+
contents: write
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
env:
15+
CYGWIN_SHELL: C:\cygwin\bin\bash.exe --noprofile --norc -eo pipefail '{0}'
16+
17+
jobs:
18+
release:
19+
runs-on: windows-latest
20+
name: Build and publish Cygwin x86_64
21+
timeout-minutes: 90
22+
23+
steps:
24+
- run: git config --global core.autocrlf input
25+
26+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
27+
28+
- uses: cygwin/cygwin-install-action@8be4a7277a684c177c0fefca7d75c9c24a45055e # v6
29+
with:
30+
packages: |
31+
gcc-g++
32+
cmake
33+
make
34+
ninja
35+
curl
36+
37+
- name: Build environment
38+
shell: C:\cygwin\bin\bash.exe --noprofile --norc -eo pipefail '{0}'
39+
run: >
40+
echo "GCC: $(g++ -dumpfullversion),
41+
$(cmake --version | head -1),
42+
Cygwin $(uname -r)"
43+
44+
- name: Download GoogleTest
45+
shell: C:\cygwin\bin\bash.exe --noprofile --norc -eo pipefail '{0}'
46+
run: >
47+
curl -sL https://github.com/google/googletest/archive/refs/tags/v1.16.0.tar.gz
48+
| tar xz && mv googletest-1.16.0 googletest-src
49+
50+
- name: Configure GoogleTest
51+
shell: C:\cygwin\bin\bash.exe --noprofile --norc -eo pipefail '{0}'
52+
run: >
53+
cmake -S googletest-src -B gtest-build -G Ninja
54+
-DCMAKE_CXX_STANDARD=17
55+
-DCMAKE_BUILD_TYPE=Release
56+
-DCMAKE_CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=1"
57+
-DCMAKE_INSTALL_PREFIX="$PWD/staging/usr/local/lib/absl/vendor"
58+
59+
- name: Build GoogleTest
60+
shell: C:\cygwin\bin\bash.exe --noprofile --norc -eo pipefail '{0}'
61+
run: ninja -C gtest-build -j4
62+
63+
- name: Install GoogleTest
64+
shell: C:\cygwin\bin\bash.exe --noprofile --norc -eo pipefail '{0}'
65+
run: cmake --install gtest-build
66+
67+
- name: Configure Abseil
68+
shell: C:\cygwin\bin\bash.exe --noprofile --norc -eo pipefail '{0}'
69+
run: >
70+
cmake -S . -B build -G Ninja
71+
-DCMAKE_CXX_STANDARD=17
72+
-DCMAKE_BUILD_TYPE=Release
73+
-DCMAKE_CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=1 -DGTEST_HAS_PTHREAD=1"
74+
-DCMAKE_PREFIX_PATH="$PWD/staging/usr/local/lib/absl/vendor"
75+
-DABSL_BUILD_TESTING=ON
76+
-DABSL_USE_EXTERNAL_GOOGLETEST=ON
77+
-DABSL_FIND_GOOGLETEST=ON
78+
79+
- name: Build Abseil
80+
shell: C:\cygwin\bin\bash.exe --noprofile --norc -eo pipefail '{0}'
81+
run: ninja -C build -j4
82+
83+
- name: Test
84+
shell: C:\cygwin\bin\bash.exe --noprofile --norc -eo pipefail '{0}'
85+
run: ctest --test-dir build --timeout 300 --output-on-failure
86+
87+
- name: Install Abseil
88+
shell: C:\cygwin\bin\bash.exe --noprofile --norc -eo pipefail '{0}'
89+
run: cmake --install build --prefix "$PWD/staging/usr/local"
90+
91+
- name: Patch abslConfig.cmake for vendored GoogleTest
92+
shell: C:\cygwin\bin\bash.exe --noprofile --norc -eo pipefail '{0}'
93+
run: >
94+
printf '\n# Vendored GoogleTest for test helper targets (scoped_mock_log, status_matchers)\nif(NOT TARGET GTest::gtest)\n find_package(GTest QUIET HINTS "${CMAKE_CURRENT_LIST_DIR}/../../absl/vendor/lib/cmake/GTest")\nendif()\n'
95+
>> staging/usr/local/lib/cmake/absl/abslConfig.cmake
96+
97+
- name: Package
98+
shell: C:\cygwin\bin\bash.exe --noprofile --norc -eo pipefail '{0}'
99+
run: >
100+
tar czf "abseil-cpp-$GITHUB_REF_NAME-x86_64.tar.gz" -C staging usr
101+
102+
- name: Checksum
103+
shell: C:\cygwin\bin\bash.exe --noprofile --norc -eo pipefail '{0}'
104+
run: >
105+
sha256sum "abseil-cpp-$GITHUB_REF_NAME-x86_64.tar.gz" > checksums-sha256.txt
106+
&& cat checksums-sha256.txt
107+
108+
- name: Create release notes
109+
shell: C:\cygwin\bin\bash.exe --noprofile --norc -eo pipefail '{0}'
110+
run: >
111+
python3 -c "
112+
import subprocess, os;
113+
tag = os.environ['GITHUB_REF_NAME'];
114+
ver = tag.replace('-cygwin', '');
115+
artifact = f'abseil-cpp-{tag}-x86_64.tar.gz';
116+
gcc = subprocess.check_output(['g++', '-dumpfullversion']).decode().strip();
117+
cmake = subprocess.check_output(['cmake', '--version']).decode().split('\n')[0];
118+
cygwin = subprocess.check_output(['uname', '-r']).decode().strip();
119+
body = f'''Pre-built static libraries and headers for Cygwin x86_64.
120+
121+
**Build environment**: GCC {gcc}, {cmake}, Cygwin {cygwin}, Release mode
122+
**ABI**: \`-D_GLIBCXX_USE_CXX11_ABI=1\` (SSO strings, required for Protobuf compatibility)
123+
**Prefix**: \`/usr/local\` (does not conflict with system abseil in \`/usr\`)
124+
**GoogleTest**: 1.16.0, vendored at \`lib/absl/vendor/\`
125+
126+
## Installation
127+
128+
Extract at the filesystem root to install into \`/usr/local\`:
129+
130+
\`\`\`bash
131+
cd / && tar xzf {artifact}
132+
\`\`\`
133+
134+
Verify checksum:
135+
136+
\`\`\`bash
137+
sha256sum -c checksums-sha256.txt
138+
\`\`\`
139+
140+
## Contents
141+
142+
- Libraries in \`/usr/local/lib/libabsl_*.a\`
143+
- Headers in \`/usr/local/include/absl/\`
144+
- CMake config in \`/usr/local/lib/cmake/absl/\`
145+
- Vendored GoogleTest in \`/usr/local/lib/absl/vendor/\`
146+
- pkg-config in \`/usr/local/lib/pkgconfig/absl_*.pc\`
147+
148+
## Usage
149+
150+
\`\`\`cmake
151+
list(APPEND CMAKE_PREFIX_PATH /usr/local)
152+
find_package(absl REQUIRED)
153+
\`\`\`
154+
155+
No separate \`find_package(GTest)\` is needed.
156+
157+
## Purpose
158+
159+
These binaries support the Cygwin port of Protocol Buffers 7.35.0 at
160+
[phdye-cygwin/protobuf](https://github.com/phdye-cygwin/protobuf).
161+
''';
162+
open('release-notes.md', 'w').write(body)
163+
"
164+
165+
- name: Publish release
166+
env:
167+
GH_TOKEN: ${{ github.token }}
168+
shell: C:\cygwin\bin\bash.exe --noprofile --norc -eo pipefail '{0}'
169+
run: >
170+
gh release create "$GITHUB_REF_NAME"
171+
--title "Abseil LTS ${GITHUB_REF_NAME%-cygwin} — Cygwin x86_64"
172+
--notes-file release-notes.md
173+
"abseil-cpp-$GITHUB_REF_NAME-x86_64.tar.gz" checksums-sha256.txt

0 commit comments

Comments
 (0)