Skip to content

Commit 7770d14

Browse files
committed
Fix release workflow: remove igncr, add diagnostics
Cygwin bash on the CI runner does not support -O igncr. Revert to the proven > (folded scalar) approach used by the CI workflows, add diagnostic output to the download and configure steps, replace Python release notes with printf, and use shell: bash for the publish step to ensure gh is on PATH.
1 parent f72d398 commit 7770d14

1 file changed

Lines changed: 78 additions & 79 deletions

File tree

.github/workflows/release.yml

Lines changed: 78 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
timeout-minutes: 90
1919
defaults:
2020
run:
21-
shell: C:\cygwin\bin\bash.exe --noprofile --norc -O igncr -eo pipefail '{0}'
21+
shell: C:\cygwin\bin\bash.exe --noprofile --norc -eo pipefail '{0}'
2222

2323
steps:
2424
- run: git config --global core.autocrlf input
@@ -36,31 +36,32 @@ jobs:
3636
curl
3737
3838
- name: Build environment
39-
run: |
40-
echo "GCC: $(g++ -dumpfullversion)"
41-
echo "CMake: $(cmake --version | head -1)"
42-
echo "Cygwin: $(uname -r)"
43-
echo "CWD: $(pwd)"
39+
run: >
40+
echo "GCC=$(g++ -dumpfullversion) CMake=$(cmake --version | head -1) Cygwin=$(uname -r) CWD=$(pwd)"
4441
4542
- name: Download GoogleTest
46-
run: |
43+
run: >
4744
curl -fL -o gtest.tar.gz https://github.com/google/googletest/archive/refs/tags/v1.16.0.tar.gz
48-
ls -l gtest.tar.gz
49-
tar xzf gtest.tar.gz
50-
mv googletest-1.16.0 googletest-src
51-
test -d googletest-src
45+
&& echo "Downloaded $(ls -la gtest.tar.gz)"
46+
&& tar xzf gtest.tar.gz
47+
&& mv googletest-1.16.0 googletest-src
48+
&& echo "Extracted: $(ls -d googletest-src)"
5249
5350
- name: Configure GoogleTest
5451
run: >
55-
cmake -S googletest-src -B gtest-build -G Ninja
52+
echo "CWD=$(pwd) src=$(ls -d googletest-src)"
53+
&& cmake -S googletest-src -B gtest-build -G Ninja
5654
-DCMAKE_CXX_STANDARD=17
5755
-DCMAKE_BUILD_TYPE=Release
5856
-DCMAKE_CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=1"
5957
-DCMAKE_INSTALL_PREFIX="$PWD/staging/usr/local/lib/absl/vendor"
6058
61-
- name: Build and install GoogleTest
62-
run: |
59+
- name: Build GoogleTest
60+
run: >
6361
ninja -C gtest-build -j4
62+
63+
- name: Install GoogleTest
64+
run: >
6465
cmake --install gtest-build
6566
6667
- name: Configure Abseil
@@ -75,85 +76,83 @@ jobs:
7576
-DABSL_FIND_GOOGLETEST=ON
7677
7778
- name: Build Abseil
78-
run: ninja -C build -j4
79+
run: >
80+
ninja -C build -j4
7981
8082
- name: Test
81-
run: ctest --test-dir build --timeout 300 --output-on-failure
83+
run: >
84+
ctest --test-dir build --timeout 300 --output-on-failure
8285
8386
- name: Install Abseil
84-
run: cmake --install build --prefix "$PWD/staging/usr/local"
87+
run: >
88+
cmake --install build --prefix "$PWD/staging/usr/local"
8589
8690
- name: Patch abslConfig.cmake for vendored GoogleTest
87-
run: |
88-
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' >> staging/usr/local/lib/cmake/absl/abslConfig.cmake
91+
run: >
92+
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'
93+
>> staging/usr/local/lib/cmake/absl/abslConfig.cmake
8994
9095
- name: Package
91-
run: tar czf "abseil-cpp-$GITHUB_REF_NAME-x86_64.tar.gz" -C staging usr
96+
run: >
97+
tar czf "abseil-cpp-$GITHUB_REF_NAME-x86_64.tar.gz" -C staging usr
9298
9399
- name: Checksum
94-
run: |
95-
sha256sum "abseil-cpp-$GITHUB_REF_NAME-x86_64.tar.gz" > checksums-sha256.txt
96-
cat checksums-sha256.txt
100+
run: >
101+
sha256sum "abseil-cpp-$GITHUB_REF_NAME-x86_64.tar.gz" | tee checksums-sha256.txt
97102
98103
- name: Create release notes
99-
run: |
100-
tag="$GITHUB_REF_NAME"
101-
ver="${tag%-cygwin}"
102-
artifact="abseil-cpp-${tag}-x86_64.tar.gz"
103-
gcc="$(g++ -dumpfullversion)"
104-
cmake_ver="$(cmake --version | head -1)"
105-
cygwin_ver="$(uname -r)"
106-
cat > release-notes.md <<EOF
107-
Pre-built static libraries and headers for Cygwin x86_64.
108-
109-
**Build environment**: GCC ${gcc}, ${cmake_ver}, Cygwin ${cygwin_ver}, Release mode
110-
**ABI**: \`-D_GLIBCXX_USE_CXX11_ABI=1\` (SSO strings, required for Protobuf compatibility)
111-
**Prefix**: \`/usr/local\` (does not conflict with system abseil in \`/usr\`)
112-
**GoogleTest**: 1.16.0, vendored at \`lib/absl/vendor/\`
113-
114-
## Installation
115-
116-
Extract at the filesystem root to install into \`/usr/local\`:
117-
118-
\`\`\`bash
119-
cd / && tar xzf ${artifact}
120-
\`\`\`
121-
122-
Verify checksum:
123-
124-
\`\`\`bash
125-
sha256sum -c checksums-sha256.txt
126-
\`\`\`
127-
128-
## Contents
129-
130-
- Libraries in \`/usr/local/lib/libabsl_*.a\`
131-
- Headers in \`/usr/local/include/absl/\`
132-
- CMake config in \`/usr/local/lib/cmake/absl/\`
133-
- Vendored GoogleTest in \`/usr/local/lib/absl/vendor/\`
134-
- pkg-config in \`/usr/local/lib/pkgconfig/absl_*.pc\`
135-
136-
## Usage
137-
138-
\`\`\`cmake
139-
list(APPEND CMAKE_PREFIX_PATH /usr/local)
140-
find_package(absl REQUIRED)
141-
\`\`\`
142-
143-
No separate \`find_package(GTest)\` is needed.
144-
145-
## Purpose
146-
147-
These binaries support the Cygwin port of Protocol Buffers 7.35.0 at
148-
[phdye-cygwin/protobuf](https://github.com/phdye-cygwin/protobuf).
149-
EOF
104+
run: >
105+
printf '%s\n'
106+
"Pre-built static libraries and headers for Cygwin x86_64."
107+
""
108+
"**Build environment**: GCC $(g++ -dumpfullversion), $(cmake --version | head -1), Cygwin $(uname -r), Release mode"
109+
"**ABI**: \`-D_GLIBCXX_USE_CXX11_ABI=1\` (SSO strings, required for Protobuf compatibility)"
110+
"**Prefix**: \`/usr/local\` (does not conflict with system abseil in \`/usr\`)"
111+
"**GoogleTest**: 1.16.0, vendored at \`lib/absl/vendor/\`"
112+
""
113+
"## Installation"
114+
""
115+
"Extract at the filesystem root to install into \`/usr/local\`:"
116+
""
117+
"\`\`\`bash"
118+
"cd / && tar xzf abseil-cpp-$GITHUB_REF_NAME-x86_64.tar.gz"
119+
"\`\`\`"
120+
""
121+
"Verify checksum:"
122+
""
123+
"\`\`\`bash"
124+
"sha256sum -c checksums-sha256.txt"
125+
"\`\`\`"
126+
""
127+
"## Contents"
128+
""
129+
"- Libraries in \`/usr/local/lib/libabsl_*.a\`"
130+
"- Headers in \`/usr/local/include/absl/\`"
131+
"- CMake config in \`/usr/local/lib/cmake/absl/\`"
132+
"- Vendored GoogleTest in \`/usr/local/lib/absl/vendor/\`"
133+
"- pkg-config in \`/usr/local/lib/pkgconfig/absl_*.pc\`"
134+
""
135+
"## Usage"
136+
""
137+
"\`\`\`cmake"
138+
"list(APPEND CMAKE_PREFIX_PATH /usr/local)"
139+
"find_package(absl REQUIRED)"
140+
"\`\`\`"
141+
""
142+
"No separate \`find_package(GTest)\` is needed."
143+
""
144+
"## Purpose"
145+
""
146+
"These binaries support the Cygwin port of Protocol Buffers 7.35.0 at"
147+
"[phdye-cygwin/protobuf](https://github.com/phdye-cygwin/protobuf)."
148+
> release-notes.md
150149
151150
- name: Publish release
152151
shell: bash
153152
env:
154153
GH_TOKEN: ${{ github.token }}
155-
run: |
156-
gh release create "$GITHUB_REF_NAME" \
157-
--title "Abseil LTS ${GITHUB_REF_NAME%-cygwin} — Cygwin x86_64" \
158-
--notes-file release-notes.md \
159-
"abseil-cpp-$GITHUB_REF_NAME-x86_64.tar.gz" checksums-sha256.txt
154+
run: >
155+
gh release create "$GITHUB_REF_NAME"
156+
--title "Abseil LTS ${GITHUB_REF_NAME%-cygwin} — Cygwin x86_64"
157+
--notes-file release-notes.md
158+
"abseil-cpp-$GITHUB_REF_NAME-x86_64.tar.gz" checksums-sha256.txt

0 commit comments

Comments
 (0)