test f87e7964bddec089f7fcac7fc7a9b3dcd5669df9 #37
Workflow file for this run
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: Build | |
on: | |
push: | |
tags: ['**'] | |
jobs: | |
build: | |
name: ${{ matrix.config.target }} | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 180 | |
strategy: | |
matrix: | |
config: | |
- target: x86_64-unknown-linux-gnu | |
variant: release | |
- target: aarch64-linux-android | |
variant: release | |
env: | |
V8_FROM_SOURCE: 1 | |
CARGO_VARIANT_FLAG: ${{ matrix.config.variant == 'release' && '--release' || '' }} | |
LIB_NAME: librusty_v8 | |
LIB_EXT: a | |
RUSTFLAGS: -D warnings | |
steps: | |
- name: Checkout to rusty_v8_builder | |
uses: actions/checkout@v4 | |
- name: Get version | |
id: get_version | |
run: | | |
version=$(cat ./README.md | grep -oP 'v\d+\.\d+\.\d+') | |
echo "version=$version" >> $GITHUB_OUTPUT | |
- name: Checkout to rusty_v8 | |
uses: actions/checkout@v4 | |
with: | |
repository: denoland/rusty_v8 | |
ref: f87e7964bddec089f7fcac7fc7a9b3dcd5669df9 | |
fetch-depth: 10 | |
submodules: recursive | |
- name: Install rust | |
uses: dsherret/rust-toolchain-file@v1 | |
- name: Install python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11.x | |
architecture: x64 | |
- name: Install cross compilation toolchain | |
if: matrix.config.target == 'aarch64-linux-android' | |
run: | | |
rustup target add aarch64-linux-android | |
- name: Write git_submodule_status.txt | |
run: git submodule status --recursive > git_submodule_status.txt | |
- name: Cache | |
uses: actions/cache@v3 | |
with: | |
path: |- | |
target/sccache | |
target/*/.* | |
target/*/build | |
target/*/deps | |
key: cargo-${{ matrix.config.target }}-${{ matrix.config.variant }}-${{ hashFiles('Cargo.lock', 'build.rs', 'git_submodule_status.txt') }} | |
restore-keys: cargo-${{ matrix.config.target }}-${{ matrix.config.variant }}- | |
- name: Sccache | |
shell: pwsh | |
env: | |
SCCACHE_DIR: ${{ github.workspace }}/target/sccache | |
SCCACHE_CACHE_SIZE: 128M | |
SCCACHE_IDLE_TIMEOUT: 0 | |
run: | | |
$version = "0.2.12" | |
$platform = | |
@{ "macOS" = "x86_64-apple-darwin" | |
"Linux" = "x86_64-unknown-linux-musl" | |
"Windows" = "x86_64-pc-windows-msvc" | |
}.${{ runner.os }} | |
$basename = "sccache-$version-$platform" | |
$url = "https://github.com/mozilla/sccache/releases/download/" + | |
"$version/$basename.tar.gz" | |
cd ~ | |
curl -LO $url | |
tar -xzvf "$basename.tar.gz" | |
. $basename/sccache --start-server | |
echo "$(pwd)/$basename" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
- name: Build | |
run: cargo build -vv --locked ${{ env.CARGO_VARIANT_FLAG }} --target ${{ matrix.config.target }} | |
- name: Prepare Release | |
run: gzip -9c | |
target/${{ matrix.config.target }}/${{ matrix.config.variant }}/gn_out/obj/${{ env.LIB_NAME }}.${{ env.LIB_EXT }} > | |
target/${{ env.LIB_NAME }}_${{ matrix.config.variant }}_${{ matrix.config.target }}.${{ env.LIB_EXT }}.gz && | |
ls -l target/${{ env.LIB_NAME }}_${{ matrix.config.variant }}_${{ matrix.config.target }}.${{ env.LIB_EXT }}.gz | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: target/${{ env.LIB_NAME }}_${{ matrix.config.variant }}_${{ matrix.config.target }}.${{ env.LIB_EXT }}.gz |