Skip to content

build(deps-dev): bump @types/node from 22.9.3 to 22.10.1 in /flipt-client-node #368

build(deps-dev): bump @types/node from 22.9.3 to 22.10.1 in /flipt-client-node

build(deps-dev): bump @types/node from 22.9.3 to 22.10.1 in /flipt-client-node #368

name: Package FFI Engine
on:
pull_request:
branches:
- main
push:
tags: ["flipt-engine-ffi-v**"]
workflow_dispatch:
inputs:
tag:
description: "Tag (e.g. v0.1.0)"
required: true
permissions:
contents: write
jobs:
build:
strategy:
fail-fast: false
matrix:
platform:
- name: Linux-x86_64
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
use_cross: false
- name: Linux-arm64
os: ubuntu-latest
target: aarch64-unknown-linux-gnu
use_cross: true
- name: Linux-x86_64-musl
os: ubuntu-latest
target: x86_64-unknown-linux-musl
use_cross: true
- name: Linux-arm64-musl
os: ubuntu-latest
target: aarch64-unknown-linux-musl
use_cross: true
- name: Darwin-arm64
os: macos-latest
target: aarch64-apple-darwin
use_cross: false
- name: Darwin-x86_64
os: macos-latest
target: x86_64-apple-darwin
use_cross: false
- name: Windows-x86_64
os: windows-latest
target: x86_64-pc-windows-msvc
use_cross: false
- name: iOS-arm64
os: macos-latest
target: aarch64-apple-ios
use_cross: false
- name: iOS-arm64-sim
os: macos-latest
target: aarch64-apple-ios-sim
use_cross: false
- name: Android-arm64
os: ubuntu-latest
target: aarch64-linux-android
use_cross: true
- name: Android-x86_64
os: ubuntu-latest
target: x86_64-linux-android
use_cross: true
runs-on: ${{ matrix.platform.os }}
env:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v4
- name: Install Rust ${{ matrix.platform.name }}
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.platform.target }}
override: true
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ matrix.platform.target}}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Set RUSTFLAGS
if: endsWith(matrix.platform.target, '-musl')
run: |
echo "RUSTFLAGS=-C target-feature=-crt-static" >> $GITHUB_ENV
- name: Install cross from GitHub
run: |
which cross || cargo install cross --git https://github.com/cross-rs/cross
- name: Build ${{ matrix.platform.name }}
uses: actions-rs/cargo@v1
with:
command: build
args: -p flipt-engine-ffi --target ${{ matrix.platform.target }} --release
use-cross: ${{ matrix.platform.use_cross }}
- if: startsWith(matrix.platform.name, 'Darwin')
run: |
strip -x target/${{ matrix.platform.target }}/release/libfliptengine.dylib
- if: startsWith(matrix.platform.name, 'Linux-x86_64')
run: |
strip -x target/${{ matrix.platform.target }}/release/libfliptengine.so
- if: ${{ !startsWith(matrix.platform.name, 'Windows') }}
run: |
tar -czvf flipt-engine-ffi-${{ matrix.platform.name }}.tar.gz \
target/${{ matrix.platform.target }}/release/libfliptengine.* \
|| true
- if: startsWith(matrix.platform.name, 'Windows')
run: |
7z a -tzip flipt-engine-ffi-${{ matrix.platform.name }}.zip `
target\${{ matrix.platform.target }}\release\fliptengine.* `
|| true
- name: Upload To Pull Request (Pull Request)
uses: actions/upload-artifact@v4
if: github.event_name == 'pull_request' && startsWith(github.head_ref, 'package/')
with:
name: flipt-engine-ffi-${{ matrix.platform.name }}${{ startsWith(matrix.platform.name, 'Windows') && '.zip' || '.tar.gz' }}
path: flipt-engine-ffi-${{ matrix.platform.name }}${{ startsWith(matrix.platform.name, 'Windows') && '.zip' || '.tar.gz' }}
- name: Upload Release Assets (Tag)
uses: softprops/action-gh-release@v2
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/flipt-engine-ffi-v')
with:
tag_name: ${{ github.ref_name }}
files: |
flipt-engine-ffi-${{ matrix.platform.name }}${{ startsWith(matrix.platform.name, 'Windows') && '.zip' || '.tar.gz' }}
- name: Upload Release Assets (Workflow Dispatch)
uses: softprops/action-gh-release@v2
if: github.event_name == 'workflow_dispatch' && !endswith(github.event.inputs.tag, 'pre')
with:
tag_name: flipt-engine-ffi-${{ github.event.inputs.tag }}
files: |
flipt-engine-ffi-${{ matrix.platform.name }}${{ startsWith(matrix.platform.name, 'Windows') && '.zip' || '.tar.gz' }}