Set Mac target arch to x86_64 #60
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
on: | |
push: | |
tags: | |
- "v*" | |
name: Release | |
jobs: | |
build: | |
name: Build | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-2019, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Get branch name | |
id: branch-name | |
uses: tj-actions/branch-names@v4.9 | |
- name: Set outputs | |
id: vars | |
run: echo "::set-output name=release_file_name::flo-release-${{ steps.branch-name.outputs.tag }}-${{ runner.os }}.zip" | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
with: | |
submodules: 'recursive' | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- name: Build tools | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release -p flo-ping | |
- name: Set flo-worker env | |
if: ${{ runner.os == 'Windows' }} | |
run: | | |
echo "BONJOUR_SDK_HOME=${{ github.workspace }}\deps\bonjour-sdk-windows" >> $env:GITHUB_ENV | |
- name: Build flo-worker | |
uses: actions-rs/cargo@v1 | |
if: ${{ runner.os == 'Windows' }} | |
with: | |
command: build | |
args: --release -p flo-worker | |
# Build the x86_64 binary for MacOS until a good way to build fat libs is created | |
- name: Build flo-worker | |
uses: actions-rs/cargo@v1 | |
if: ${{ runner.os == 'macOS' }} | |
with: | |
command: build | |
args: --release -p flo-worker --target x86_64-apple-darwin | |
- name: Archive | |
if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }} | |
uses: thedoctor0/zip-release@master | |
with: | |
type: 'zip' | |
filename: ${{ steps.vars.outputs.release_file_name }} | |
directory: target/release | |
exclusions: '.* /*.fingerprint/* /*build/* /*deps/* /*examples/* /*incremental/* *.pdb *.d *.rlib' | |
- name: Archive | |
if: ${{ runner.os == 'Windows' }} | |
run: | | |
cd target\release | |
7z a ${{ steps.vars.outputs.release_file_name }} flo-worker.exe flo-ping.exe | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: flo-${{ matrix.os }} | |
path: target/release/*.zip | |
retention-days: 1 | |
release: | |
name: Release | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get branch name | |
id: branch-name | |
uses: tj-actions/branch-names@v4.9 | |
- uses: actions/download-artifact@v4 | |
- name: Release | |
uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
prerelease: true | |
automatic_release_tag: ${{ steps.branch-name.outputs.tag }} | |
files: | | |
flo-windows-2019/*.zip | |
flo-macos-latest/*.zip | |
flo-ubuntu-latest/*.zip |