Skip to content

Commit

Permalink
feast: added cross build
Browse files Browse the repository at this point in the history
  • Loading branch information
Wildhoney committed Mar 15, 2024
1 parent d087158 commit 3897da1
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 1 deletion.
72 changes: 72 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Build

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

env:
CARGO_TERM_COLOR: always

jobs:
release:
name: Release - ${{ matrix.platform.release_for }}
strategy:
matrix:
platform:
- release_for: FreeBSD-x86_64
os: ubuntu-20.04
target: x86_64-unknown-freebsd
bin: precious
name: precious-FreeBSD-x86_64.tar.gz
command: build

- release_for: Windows-x86_64
os: windows-latest
target: x86_64-pc-windows-msvc
bin: precious.exe
name: precious-Windows-x86_64.zip
command: both

- release_for: macOS-x86_64
os: macOS-latest
target: x86_64-apple-darwin
bin: precious
name: precious-Darwin-x86_64.tar.gz
command: both

runs-on: ${{ matrix.platform.os }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Build Binary
uses: houseabsolute/actions-rust-cross@v0
with:
command: ${{ matrix.platform.command }}
target: ${{ matrix.platform.target }}
args: "--locked --release"
strip: true

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v1
release_name: Release v1
draft: false
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 }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ${{ matrix.platform.name }}
asset_name: ${{ matrix.platform.name }}
asset_content_type: application/zip
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Rust
name: Integrity

on:
push:
Expand All @@ -17,5 +17,6 @@ jobs:
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose

- name: Run tests
run: cargo test --verbose -- --test-threads 1

0 comments on commit 3897da1

Please sign in to comment.