Skip to content

Build

Build #4

Workflow file for this run

name: Build
on:
workflow_dispatch:
push:
tags: ['v*']
permissions:
contents: write
jobs:
build:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
targets: aarch64-apple-darwin,x86_64-apple-darwin,aarch64-apple-ios,aarch64-apple-ios-sim,x86_64-apple-ios
- name: Install cbindgen
run: brew install cbindgen
- name: Run cargo build for each macos target
run: make macos
- name: Run cargo build for each ios target
run: make ios
- name: Generate header file
run: cbindgen --config cbindgen.toml --crate fiber_ffi --output include/fiber_ffi.h
- name: Create binary framework
run: |
xcodebuild -create-xcframework \
-library libs/libfiber_ffi_macos.a \
-headers ./include/ \
-library libs/libfiber_ffi_ios_sim.a \
-headers ./include/ \
-library libs/libfiber_ffi_ios.a \
-headers ./include/ \
-output FiberFFI.xcframework
- name: Create zipped framework
run: zip -r framework.zip FiberFFI.xcframework
- name: Generate checksum
run: openssl dgst -sha256 framework.zip
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./framework.zip
asset_name: framework.zip
asset_content_type: application/zip
#- name: Invoke workflow without inputs
# uses: peter-evans/repository-dispatch@v3
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# repository: szkabaroli/SwiftRusty
# event-type: new-release
# client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'