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 (1.x) #949

Merged
merged 2 commits into from
Aug 23, 2024
Merged
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
5 changes: 5 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ runs:
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
run: |
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,21 @@ jobs:
name: Linux arm64
preset: linux-arm64

- os: ubuntu-22.04
container: openziti/ziti-builder:v2
name: Linux x86_64 static
preset: linux-x64-static

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

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

steps:
- name: Debug action
uses: hmarr/debug-action@v3
Expand Down
40 changes: 16 additions & 24 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ jobs:
with:
path: ${{ runner.workspace }}/downloads/

# This step is only necessary because we prefer a different release artifact name
# than is created by CMake, and so we could change the CMake configuration but for
# now this is easier. The pre-release build doesn't rename the artifacts.
- name: Rename bundle assets
working-directory: ${{ runner.workspace }}/downloads/
run: |
mv linux-arm64/ziti-edge-tunnel-Linux_aarch64.zip linux-arm64/ziti-edge-tunnel-Linux_arm64.zip
mv windows-x64-mingw/ziti-edge-tunnel-Windows_AMD64.zip windows-x64-mingw/ziti-edge-tunnel-Windows_x86_64.zip
mv linux-arm-static/ziti-edge-tunnel-Linux_arm.zip linux-arm-static/ziti-edge-tunnel-Linux_arm-static.zip
mv linux-arm64-static/ziti-edge-tunnel-Linux_aarch64.zip linux-arm64-static/ziti-edge-tunnel-Linux_arm64-static.zip
mv linux-x64-static/ziti-edge-tunnel-Linux_x86_64.zip linux-arm64-static/ziti-edge-tunnel-Linux_x86_64-static.zip

- name: List Release Artifacts
run: ls -horRAS ${{runner.workspace}}/downloads/

Expand All @@ -36,35 +48,15 @@ jobs:
# token: defaults to github.token
fail_on_unmatched_files: true
files: |
${{ runner.workspace }}/downloads/linux-arm-static/ziti-edge-tunnel-Linux_arm-static.zip
${{ runner.workspace }}/downloads/linux-arm64-static/ziti-edge-tunnel-Linux_arm64-static.zip
${{ runner.workspace }}/downloads/linux-arm64-static/ziti-edge-tunnel-Linux_x86_64-static.zip
${{ runner.workspace }}/downloads/linux-x64/ziti-edge-tunnel-Linux_x86_64.zip
${{ runner.workspace }}/downloads/linux-arm/ziti-edge-tunnel-Linux_arm.zip
${{ runner.workspace }}/downloads/linux-arm64/ziti-edge-tunnel-Linux_arm64.zip
${{ runner.workspace }}/downloads/macOS-x64/ziti-edge-tunnel-Darwin_x86_64.zip
${{ runner.workspace }}/downloads/macOS-arm64/ziti-edge-tunnel-Darwin_arm64.zip

# These final two steps are only necessary because we prefer a different
# release artifact name than is created by CMake, and so we could change
# the CMake configuration or add an inline (shell) run step to manipulate
# the filenames. The pre-release build doesn't rename the artifacts.
- name: upload Linux ARM64 with different name
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ${{ runner.workspace }}/downloads/linux-arm64/ziti-edge-tunnel-Linux_aarch64.zip
asset_name: ziti-edge-tunnel-Linux_arm64.zip
asset_content_type: application/octet-stream

- name: upload Windows with different name
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ${{ runner.workspace }}/downloads/windows-x64-mingw/ziti-edge-tunnel-Windows_AMD64.zip
asset_name: ziti-edge-tunnel-Windows_x86_64.zip
asset_content_type: application/octet-stream

- name: Get the Version String from Git Tag
id: get_version
env:
Expand Down
24 changes: 24 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,30 @@
"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",
"CMAKE_SUPPRESS_REGENERATION": "ON",
"CMAKE_FIND_LIBRARY_SUFFIXES": ".a"
},
"hidden": true
},
{
"name": "ci-linux-x64-static",
"inherits": [ "ci-linux-static", "ci-linux-x64" ]
},
{
"name": "ci-linux-arm64-static",
"inherits": [ "ci-linux-static", "ci-linux-arm64" ]
},
{
"name": "ci-linux-arm-static",
"inherits": [ "ci-linux-static", "ci-linux-arm" ]
},
{
"name": "ci-windows-x64",
"inherits": "ci-windows-x64-vs2022"
Expand Down
Loading