Skip to content

Commit

Permalink
ci: build fully static release binaries.
Browse files Browse the repository at this point in the history
  • Loading branch information
plusvic committed Mar 25, 2024
1 parent 1e8496d commit 74c5e16
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:
- build: linux
os: ubuntu-latest
rust: stable
args: ""
args: "--features=openssl-static"

- build: macos
os: macos-latest
rust: stable
args: ""
args: "--features=openssl-static"

- build: windows
os: windows-latest
Expand All @@ -49,18 +49,25 @@ jobs:
triplet: x64-windows-static
token: ${{ github.token }}

- name: Set OPENSSL_DIR environment variable
if: runner.os == 'Windows'
- name: Set OPENSSL environment variables
shell: bash
run: echo "OPENSSL_DIR=${{ github.workspace }}\\vcpkg\\installed\\x64-windows-static" >> $GITHUB_ENV
run: |
if [ "${{ matrix.build }}" = "windows" ]; then
echo "OPENSSL_DIR=${{ github.workspace }}\\vcpkg\\installed\\x64-windows-release" >> $GITHUB_ENV
else
echo "OPENSSL_LIB_DIR=/usr/lib/x86_64-linux-gnu" >> $GITHUB_ENV
echo "OPENSSL_INCLUDE_DIR="/usr/include/openssl" >> $GITHUB_ENV
fi
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}

- name: Build
run: cargo build --profile release-lto ${{ matrix.args }}
run: cargo build --profile release-lto ${{ matrix.args }}
env:
RUSTFLAGS: "-C target-feature=+crt-static"

- name: Build archive
shell: bash
Expand Down

0 comments on commit 74c5e16

Please sign in to comment.