Update Rust crate wry to v0.48.1 #255
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust Binary | |
on: | |
push: | |
jobs: | |
build: | |
name: Build on ${{ matrix.os }} for ${{ matrix.target }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: ${{ github.ref == 'refs/heads/main' }} | |
matrix: | |
include: | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
binary_name: deno-webview-linux | |
platform: linux | |
- os: ubuntu-latest | |
target: x86_64-pc-windows-msvc | |
binary_name: deno-webview-windows | |
platform: windows | |
- os: macos-latest | |
target: x86_64-apple-darwin | |
binary_name: deno-webview-mac | |
platform: macos | |
- os: macos-latest | |
target: aarch64-apple-darwin | |
binary_name: deno-webview-mac-arm64 | |
platform: macos | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: jdx/mise-action@v2 | |
env: | |
RUSTUP_TARGET: ${{ matrix.target }} | |
MISE_ENV: ${{ matrix.platform }} | |
with: | |
cache_key_prefix: mise-${{ hashFiles('mise.toml') }}-${{ matrix.target }} | |
experimental: true | |
- run: mise x -- rustup target add ${{ matrix.target }} | |
- run: mise run ci:install-deps | |
- name: Set build flags | |
id: build_flags | |
run: | | |
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then | |
echo "flags=--release" >> $GITHUB_OUTPUT | |
echo "build_type=release" >> $GITHUB_OUTPUT | |
else | |
echo "flags=" >> $GITHUB_OUTPUT | |
echo "build_type=debug" >> $GITHUB_OUTPUT | |
fi | |
- name: Build Linux | |
if: matrix.target == 'x86_64-unknown-linux-gnu' | |
run: | | |
cargo build ${{ steps.build_flags.outputs.flags }} --target ${{ matrix.target }} -F transparent | |
mv target/${{ matrix.target }}/${{ steps.build_flags.outputs.build_type }}/deno-webview ${{ matrix.binary_name }} | |
cargo build ${{ steps.build_flags.outputs.flags }} --target ${{ matrix.target }} -F transparent -F devtools | |
mv target/${{ matrix.target }}/${{ steps.build_flags.outputs.build_type }}/deno-webview ${{ matrix.binary_name }}-devtools | |
- name: Build macOS x86_64 | |
if: matrix.target == 'x86_64-apple-darwin' | |
run: | | |
cargo build ${{ steps.build_flags.outputs.flags }} --target ${{ matrix.target }} | |
mv target/${{ matrix.target }}/${{ steps.build_flags.outputs.build_type }}/deno-webview ${{ matrix.binary_name }} | |
cargo build ${{ steps.build_flags.outputs.flags }} --target ${{ matrix.target }} -F transparent | |
mv target/${{ matrix.target }}/${{ steps.build_flags.outputs.build_type }}/deno-webview ${{ matrix.binary_name }}-transparent | |
cargo build ${{ steps.build_flags.outputs.flags }} --target ${{ matrix.target }} -F transparent -F devtools | |
mv target/${{ matrix.target }}/${{ steps.build_flags.outputs.build_type }}/deno-webview ${{ matrix.binary_name }}-devtools | |
- name: Build (aarch64-apple-darwin) | |
if: matrix.target == 'aarch64-apple-darwin' | |
run: | | |
SDKROOT=$(xcrun -sdk macosx --show-sdk-path) MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx --show-sdk-platform-version) cargo build ${{ steps.build_flags.outputs.flags }} --target ${{ matrix.target }} | |
mv target/${{ matrix.target }}/${{ steps.build_flags.outputs.build_type }}/deno-webview ${{ matrix.binary_name }} | |
SDKROOT=$(xcrun -sdk macosx --show-sdk-path) MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx --show-sdk-platform-version) cargo build ${{ steps.build_flags.outputs.flags }} --target ${{ matrix.target }} -F transparent | |
mv target/${{ matrix.target }}/${{ steps.build_flags.outputs.build_type }}/deno-webview ${{ matrix.binary_name }}-transparent | |
SDKROOT=$(xcrun -sdk macosx --show-sdk-path) MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx --show-sdk-platform-version) cargo build ${{ steps.build_flags.outputs.flags }} --target ${{ matrix.target }} -F transparent -F devtools | |
mv target/${{ matrix.target }}/${{ steps.build_flags.outputs.build_type }}/deno-webview ${{ matrix.binary_name }}-devtools | |
- name: Build (Windows) | |
if: matrix.target == 'x86_64-pc-windows-msvc' | |
env: | |
MISE_ENV: windows | |
run: | | |
mise x -- cargo xwin build ${{ steps.build_flags.outputs.flags }} --target ${{ matrix.target }} -F transparent | |
mv target/${{ matrix.target }}/${{ steps.build_flags.outputs.build_type }}/deno-webview.exe ${{ matrix.binary_name }}.exe | |
mise x -- cargo xwin build ${{ steps.build_flags.outputs.flags }} --target ${{ matrix.target }} -F transparent -F devtools | |
mv target/${{ matrix.target }}/${{ steps.build_flags.outputs.build_type }}/deno-webview.exe ${{ matrix.binary_name }}-devtools.exe | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ steps.build_flags.outputs.build_type }}-binary-${{ matrix.target }} | |
path: ${{ matrix.binary_name }}* |