Skip to content

Commit

Permalink
chore(CI): keep symbols to avoid triggering windows defender
Browse files Browse the repository at this point in the history
  • Loading branch information
erebe committed Jan 27, 2024
1 parent 92bea13 commit 538cfb3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ on:

env:
RUST_VERSION: 1.75.0
BUILD_ARGS: "--release"
BIN_NAME: "wstunnel"

jobs:
Expand All @@ -23,18 +22,23 @@ jobs:
# Linux
- name: Linux x86_64
target: x86_64-unknown-linux-musl
build-args: "--release"

- name: Linux aarch64
target: aarch64-unknown-linux-musl
build-args: "--release"

- name: Linux armv7hf
target: armv7-unknown-linux-musleabihf
build-args: "--release"

- name: Freebsd x86_64
target: x86_64-unknown-freebsd
build-args: "--release"

- name: Freebsd x86
target: i686-unknown-freebsd
build-args: "--release"

# - name: Android aarch64
# target: aarch64-linux-android
Expand All @@ -52,10 +56,12 @@ jobs:
- name: MacOS x86_64
os: macos-latest
target: x86_64-apple-darwin
build-args: "--release"

- name: MacOS aarch64
os: macos-latest
target: aarch64-apple-darwin
build-args: "--release"

# - name: iOS x86_64
# target: x86_64-apple-ios
Expand All @@ -69,10 +75,12 @@ jobs:
- name: Windows x86_64
os: windows-latest
target: x86_64-pc-windows-msvc
build-args: "--profile release-with-symbols"

- name: Windows x86
os: windows-latest
target: i686-pc-windows-msvc
build-args: "--profile release-with-symbols"

steps:
- name: Install package for linux
Expand Down Expand Up @@ -120,22 +128,14 @@ jobs:
with:
command: build
use-cross: ${{ !contains(matrix.platform.target, 'x86_64') || contains(matrix.platform.target, 'freebsd') }}
args: ${{ env.BUILD_ARGS }} --target ${{ matrix.platform.target }}

# Mac OS
#- name: Build ${{ matrix.platform.name }} binary
# if: contains(matrix.platform.target, 'apple')
# # We use a dedicated Rust image containing required Apple libraries to cross-compile on multiple archs
# run: |
# docker run --rm --volume "${PWD}":/root/src --workdir /root/src joseluisq/rust-linux-darwin-builder:$RUST_VERSION \
# sh -c "CC=o64-clang CXX=o64-clang++ cargo build $BUILD_ARGS --target ${{ matrix.platform.target }}"

args: ${{ matrix.platform.build-args }} --target ${{ matrix.platform.target }}

- name: Store artifact
uses: actions/upload-artifact@v3
with:
# Finally, we store the binary as GitHub artifact for later usage
name: ${{ env.BIN_NAME }}-${{ matrix.platform.target }}
path: target/${{ matrix.platform.target }}/release/${{ env.BIN_NAME }}${{ contains(matrix.platform.target, 'windows') && '.exe' || '' }}
path: target/${{ matrix.platform.target }}/release${{ contains(matrix.platform.target, 'windows') && '-with-symbols' || '' }}/${{ env.BIN_NAME }}${{ contains(matrix.platform.target, 'windows') && '.exe' || '' }}
retention-days: 1

release:
Expand Down
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,7 @@ codegen-units = 1
opt-level = 3
debug = 0
strip = "symbols"

[profile.release-with-symbols]
inherits = "release"
strip = false

0 comments on commit 538cfb3

Please sign in to comment.