This repository has been archived by the owner on Sep 12, 2024. It is now read-only.
chore: update dependencies #19
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: | |
- "v*.*.*" | |
workflow_dispatch: | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
basic: | |
strategy: | |
matrix: | |
include: | |
- os: "ubuntu-latest" | |
target: "x86_64-unknown-linux-gnu" | |
- os: "windows-latest" | |
target: "x86_64-pc-windows-msvc" | |
- os: "macos-latest" | |
target: "x86_64-apple-darwin" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: List support target platform | |
run: rustup target list | |
- uses: Swatinem/rust-cache@v2 | |
- name: Build | |
run: cargo build -vr --all-features | |
- name: List target | |
run: ls -l target/release | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.target }} | |
path: | | |
target/release/*yxy* | |
apple: | |
runs-on: "macos-latest" | |
strategy: | |
matrix: | |
target: | |
- "aarch64-apple-ios" | |
- "aarch64-apple-darwin" | |
- "aarch64-apple-ios-sim" | |
- "x86_64-apple-ios" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install target | |
run: rustup update && rustup target add ${{ matrix.target }} | |
- name: List support target platform | |
run: rustup target list | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
shared-key: ${{ matrix.target }} | |
- name: Build | |
run: cargo build -r --target ${{ matrix.target }} --all-features | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.target }} | |
path: | | |
target/${{ matrix.target }}/release/*yxy* | |
distribute: | |
needs: [basic, apple] | |
runs-on: "macos-latest" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: ./artifacts | |
- name: Display artifacts | |
run: ls -R | |
working-directory: ./artifacts | |
- name: Create fat library | |
run: | | |
mkdir universal | |
lipo -create ./artifacts/x86_64-apple-darwin/libyxy_abi.a ./artifacts/aarch64-apple-darwin/libyxy_abi.a -output ./universal/libyxy_macos.a | |
lipo -create ./artifacts/x86_64-apple-ios/libyxy_abi.a ./artifacts/aarch64-apple-ios-sim/libyxy_abi.a -output ./universal/libyxy_iossim.a | |
- name: Create XCFramework & Bundle | |
run: | | |
xcodebuild -create-xcframework -library ./universal/libyxy_macos.a -headers ./crates/abi/include/ -library ./universal/libyxy_iossim.a -headers ./crates/abi/include/ -library ./artifacts/aarch64-apple-ios/libyxy_abi.a -headers ./crates/abi/include/ -output yxy.xcframework | |
zip -r xcframework-universal.zip yxy.xcframework | |
openssl dgst -sha256 xcframework-universal.zip > xcframework-universal.zip.checksum | |
cp ./crates/abi/include/yxy.h . | |
- name: Package core crate | |
run: | | |
cargo package --no-verify -p yxy | |
- name: Upload Bundle | |
uses: actions/upload-artifact@v3 | |
with: | |
name: XCFramework | |
path: | | |
./xcframework-universal.zip | |
- name: Extract dist | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
mkdir dist | |
mv artifacts/x86_64-apple-darwin/yxy-cli dist/yxy-cli-x86_64-apple-darwin | |
mv artifacts/x86_64-apple-darwin/yxy-httpd dist/yxy-httpd-x86_64-apple-darwin | |
mv artifacts/x86_64-apple-darwin/libyxy_abi.dylib dist/libyxy-x86_64-apple-darwin.dylib | |
mv artifacts/x86_64-apple-darwin/libyxy_abi.a dist/libyxy-x86_64-apple-darwin.a | |
mv artifacts/x86_64-pc-windows-msvc/yxy-cli.exe dist/yxy-cli-x86_64-pc-windows-msvc.exe | |
mv artifacts/x86_64-pc-windows-msvc/yxy-httpd.exe dist/yxy-httpd-x86_64-pc-windows-msvc.exe | |
mv artifacts/x86_64-pc-windows-msvc/yxy_abi.dll dist/yxy-x86_64-pc-windows-msvc.dll | |
mv artifacts/x86_64-pc-windows-msvc/yxy_abi.lib dist/yxy-x86_64-pc-windows-msvc.lib | |
mv artifacts/x86_64-unknown-linux-gnu/yxy-cli dist/yxy-cli-x86_64-unknown-linux-gnu | |
mv artifacts/x86_64-unknown-linux-gnu/yxy-httpd dist/yxy-httpd-x86_64-unknown-linux-gnu | |
mv artifacts/x86_64-unknown-linux-gnu/libyxy_abi.so dist/libyxy-x86_64-unknown-linux-gnu.so | |
mv artifacts/x86_64-unknown-linux-gnu/libyxy_abi.a dist/libyxy-x86_64-unknown-linux-gnu.a | |
mv artifacts/aarch64-apple-darwin/yxy-cli dist/yxy-cli-aarch64-apple-darwin | |
mv artifacts/aarch64-apple-darwin/yxy-httpd dist/yxy-httpd-aarch64-apple-darwin | |
mv artifacts/aarch64-apple-darwin/libyxy_abi.dylib dist/libyxy-aarch64-apple-darwin.dylib | |
mv artifacts/aarch64-apple-darwin/libyxy_abi.a dist/libyxy-aarch64-apple-darwin.a | |
mv xcframework-universal.zip dist/xcframework-universal.zip | |
mv xcframework-universal.zip.checksum dist/xcframework-universal.zip.checksum | |
mv target/package/yxy-*.crate dist/ | |
mv yxy.h dist/yxy.h | |
- name: Publish Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/v') | |
with: | |
files: | | |
dist/* |