Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add static builds presets #943

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,17 @@ runs:
# use 2024.07.12 vcpkg baseline,
# see https://learn.microsoft.com/en-us/vcpkg/users/examples/versioning.getting-started#builtin-baseline
vcpkgGitCommitId: '1de2026f28ead93ff1773e6e680387643e914ea1'

- uses: lukka/[email protected] # pin version to avoid failed glibc dependency on ubuntu 20 runners. go back to @latest when ubuntu 22+ is adopted for runner os.
name: Configure CMake
with:
configurePreset: ci-${{ inputs.preset }}
configurePresetAdditionalArgs: "[ `-B`, `./build` ]"

- name: hack force libpthread.a for static builds
if: contains(inputs.preset, 'static')
shell: bash
run: "grep -rl ./build | xargs sed -i 's/libpthread.so/libpthread.a/g'"

- name: build ziti-edge-tunnel
shell: bash
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ jobs:
- os: ubuntu-20.04
container: openziti/ziti-builder:v2
name: Linux x86_64
preset: linux-x64-static-libssl
preset: linux-x64-static

- os: ubuntu-20.04
container: openziti/ziti-builder:v2
name: Linux arm
preset: linux-arm-static-libssl
preset: linux-arm-static

- os: ubuntu-20.04
container: openziti/ziti-builder:v2
name: Linux arm64
preset: linux-arm64-static-libssl
preset: linux-arm64-static

steps:
- name: Debug action
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ jobs:
# token: defaults to github.token
fail_on_unmatched_files: true
files: |
${{ runner.workspace }}/downloads/linux-x64-static-libssl/ziti-edge-tunnel-Linux_x86_64.zip
${{ runner.workspace }}/downloads/linux-arm-static-libssl/ziti-edge-tunnel-Linux_arm.zip
${{ runner.workspace }}/downloads/linux-x64-static/ziti-edge-tunnel-Linux_x86_64.zip
${{ runner.workspace }}/downloads/linux-arm-static/ziti-edge-tunnel-Linux_arm.zip
${{ runner.workspace }}/downloads/macOS-x64/ziti-edge-tunnel-Darwin_x86_64.zip
${{ runner.workspace }}/downloads/macOS-arm64/ziti-edge-tunnel-Darwin_arm64.zip

Expand All @@ -51,7 +51,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ${{ runner.workspace }}/downloads/linux-arm64-static-libssl/ziti-edge-tunnel-Linux_aarch64.zip
asset_path: ${{ runner.workspace }}/downloads/linux-arm64-static/ziti-edge-tunnel-Linux_aarch64.zip
asset_name: ziti-edge-tunnel-Linux_arm64.zip
asset_content_type: application/octet-stream

Expand Down
25 changes: 25 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,31 @@
"name": "ci-linux-arm-static-libssl",
"inherits": [ "ci-linux-static-libssl", "ci-linux-arm" ]
},
{
"name": "ci-linux-static",
"description": "preset to link executable against static libs",
"cacheVariables": {
"CMAKE_EXE_LINKER_FLAGS": "-static",
"BUILD_SHARED_LIBS": "OFF",
"ZLIB_USE_STATIC_LIBS": "ON",
"OPENSSL_USE_STATIC_LIBS": "ON",
"CMAKE_SUPPRESS_REGENERATION": "ON",
"CMAKE_FIND_LIBRARY_SUFFIXES": ".a"
},
"hidden": true
},
{
"name": "ci-linux-x64-static",
"inherits": [ "ci-linux-static", "ci-linux-static-libssl", "ci-linux-x64" ]
},
{
"name": "ci-linux-arm64-static",
"inherits": [ "ci-linux-static", "ci-linux-static-libssl", "ci-linux-arm64" ]
},
{
"name": "ci-linux-arm-static",
"inherits": [ "ci-linux-static", "ci-linux-static-libssl", "ci-linux-arm" ]
},
{
"name": "ci-windows-x64",
"inherits": "ci-windows-x64-vs2022"
Expand Down
Loading