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