Skip to content

Commit

Permalink
Fix building static binary for macos
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Hurlenko committed Jul 16, 2022
1 parent b6c05c4 commit f6f47c4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,9 @@ jobs:
# Emit backtraces on panics.
RUST_BACKTRACE: 1
BINARY: "orly"
PKG_CONFIG_ALL_STATIC: "true"
PKG_CONFIG_PATH: "/usr/local/opt/libxml2/lib/pkgconfig"
MACOSX_DEPLOYMENT_TARGET: "10.7"
MACOSX_LIBXML_VER: "2.9.13"
PKG_CONFIG_ALL_STATIC: "true"
strategy:
matrix:
build: [macos, win-msvc]
Expand Down Expand Up @@ -151,6 +150,8 @@ jobs:
run: |
# Required for windows builds
export PATH=$PATH:${{env.VCPKG_ROOT}}
export PKG_CONFIG_PATH=/usr/local/opt/libxml2@$MACOSX_LIBXML_VER/lib/pkgconfig
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH"
${{ env.CARGO }} build ${{ env.TARGET_FLAGS }} --release --locked
- name: Build archive
Expand All @@ -159,6 +160,10 @@ jobs:
run: |
staging="$BINARY-${{ needs.create-release.outputs.rg_version }}-${{ matrix.target }}"
if [ "${{ matrix.os }}" = "macos-latest" ]; then
otool -L "target/${{ matrix.target }}/release/$BINARY"
fi
if [ "${{ matrix.os }}" = "windows-2019" ]; then
cp "target/${{ matrix.target }}/release/$BINARY.exe" "$BINARY.exe"
7z a "$staging.zip" "$BINARY.exe"
Expand Down Expand Up @@ -220,6 +225,7 @@ jobs:
run: |
ARCHIVE="$BINARY-${{ needs.create-release.outputs.rg_version }}-x86_64-unknown-linux-musl.tar.gz"
cp "target/x86_64-unknown-linux-musl/release/$BINARY" "$BINARY"
ldd "$BINARY"
tar -czvf "$ARCHIVE" "$BINARY"
echo "ASSET=$ARCHIVE" >> $GITHUB_ENV
Expand Down

0 comments on commit f6f47c4

Please sign in to comment.