|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - "v*.*.*" |
| 7 | + |
| 8 | +jobs: |
| 9 | + build: |
| 10 | + strategy: |
| 11 | + fail-fast: false |
| 12 | + matrix: |
| 13 | + include: |
| 14 | + - name: "Windows MSVC17 shared library using LibreSSL" |
| 15 | + os: windows-2022 |
| 16 | + c_compiler: cl |
| 17 | + cpp_compiler: cl |
| 18 | + libressl: -DOPENSSL_ROOT_DIR:PATH=build/external/libressl/install |
| 19 | + build_type: Release |
| 20 | + release_zip: build/sockpuppet-${{ github.ref_name }}-msvc2022.zip |
| 21 | + runs-on: ${{ matrix.os }} |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v4 |
| 24 | + - name: cache externals restore |
| 25 | + id: cache-externals-restore |
| 26 | + if: matrix.libressl |
| 27 | + uses: actions/cache/restore@v3 |
| 28 | + with: |
| 29 | + path: build/external/libressl/install |
| 30 | + key: ${{ matrix.os }}-externals-${{ hashFiles('external/CMakeLists.txt') }} |
| 31 | + - name: configure externals |
| 32 | + if: matrix.libressl && (steps.cache-externals-restore.outputs.cache-hit != 'true') |
| 33 | + run: > |
| 34 | + cmake |
| 35 | + -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} |
| 36 | + -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} |
| 37 | + -DCMAKE_BUILD_TYPE:STRING=${{ matrix.build_type }} |
| 38 | + -B build/external |
| 39 | + -S external |
| 40 | + - name: build externals |
| 41 | + if: matrix.libressl && (steps.cache-externals-restore.outputs.cache-hit != 'true') |
| 42 | + run: cmake --build build/external --config ${{ matrix.build_type }} |
| 43 | + - name: cache externals save |
| 44 | + id: cache-externals-save |
| 45 | + if: matrix.libressl |
| 46 | + uses: actions/cache/save@v3 |
| 47 | + with: |
| 48 | + path: build/external/libressl/install |
| 49 | + key: ${{ steps.cache-externals-restore.outputs.cache-primary-key }} |
| 50 | + - name: configure |
| 51 | + run: > |
| 52 | + cmake |
| 53 | + -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} |
| 54 | + -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} |
| 55 | + -DCMAKE_BUILD_TYPE:STRING=${{ matrix.build_type }} |
| 56 | + -DBUILD_EXAMPLES:BOOL=ON |
| 57 | + -DBUILD_SHARED_LIBS:BOOL=ON |
| 58 | + -DWITH_TLS:BOOL=ON |
| 59 | + ${{ matrix.libressl }} |
| 60 | + -B build |
| 61 | + -S . |
| 62 | + - name: build and install |
| 63 | + run: cmake --build build --target install --config ${{ matrix.build_type }} |
| 64 | + - name: zip |
| 65 | + |
| 66 | + with: |
| 67 | + files: | |
| 68 | + build/install/include/ |
| 69 | + build/install/lib/ |
| 70 | + build/install/bin/ |
| 71 | + build/install/cmake/ |
| 72 | + dest: ${{ matrix.release_zip }} |
| 73 | + - name: release |
| 74 | + uses: softprops/action-gh-release@v2 |
| 75 | + with: |
| 76 | + files: | |
| 77 | + ${{ matrix.release_zip }} |
0 commit comments