Skip to content

Commit

Permalink
build macos on macos runner
Browse files Browse the repository at this point in the history
  • Loading branch information
bitfl0wer committed May 15, 2024
1 parent ee63c96 commit b1f3882
Showing 1 changed file with 31 additions and 7 deletions.
38 changes: 31 additions & 7 deletions .github/workflows/cross-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,15 @@ on:
required: true

jobs:
build:
name: Build and Release
build-linux-windows:
name: Build and Release for Linux and Windows
runs-on: ubuntu-latest
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- i686-unknown-linux-gnu
- aarch64-unknown-linux-gnu
- aarch64-apple-darwin
- x86_64-apple-darwin
- x86_64-pc-windows-gnu
- aarch64-pc-windows-msvc

Expand Down Expand Up @@ -46,11 +44,37 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: ${{ github.repository }}-${{ matrix.target }}
path: ./artifacts/${{ matrix.target }}-my_binary
path: ./artifacts/${{ matrix.target }}-stimmgabel*

build-macos:
name: Build and Release for MacOS
runs-on: macos-latest
strategy:
matrix:
target:
- aarch64-apple-darwin
- x86_64-apple-darwin

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Build
run: |
rustup target add ${{ matrix.target }}
cargo build --target ${{ matrix.target }} --release
mkdir -p ./artifacts
mv ./target/${{ matrix.target }}/release/stimmgabel ./artifacts/${{ matrix.target }}-stimmgabel
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ github.repository }}-${{ matrix.target }}
path: ./artifacts/${{ matrix.target }}-stimmgabel

release:
name: Release
needs: build
needs: [build-linux-windows, build-macos]
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -70,4 +94,4 @@ jobs:
prerelease: false
title: ${{ github.event.inputs.tag }}
files: |
./*
./artifacts/*

0 comments on commit b1f3882

Please sign in to comment.