Skip to content

Commit 4ff9d8d

Browse files
committed
Add macOS build workflow
1 parent 26e2138 commit 4ff9d8d

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/build-macos.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Build-macos
2+
3+
# Controls when the action will run.
4+
on:
5+
# Triggers the workflow on push or pull request events but only for the $default-branch branch
6+
push:
7+
branches: [ $default-branch ]
8+
pull_request:
9+
branches: [ $default-branch ]
10+
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
15+
jobs:
16+
# This workflow contains a single job called "build"
17+
build:
18+
# The type of runner that the job will run on
19+
runs-on: ubuntu-latest
20+
21+
# Steps represent a sequence of tasks that will be executed as part of the job
22+
steps:
23+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
24+
- uses: actions/checkout@v2
25+
- uses: actions/setup-dotnet@v1
26+
with:
27+
dotnet-version: '6.0.x' # SDK Version to use; x will use the latest version of the 3.1 channel
28+
29+
- name: Build x64 and arm64 version for macOS
30+
run: dotnet publish .\src\MultiRPC\MultiRPC.csproj -c Release -r osx-x64 && dotnet publish .\src\MultiRPC\MultiRPC.csproj -c Release -r osx-arm64
31+
32+
- name: Create x64 .app
33+
run: cp -r .\macOS Templates\MultiRPC.app .\macOS Templates\MultiRPC-x64.app && cp -r .\src\MultiRPC\bin\Release\net6.0\osx-x64\publish\ .\macOS Templates\MultiRPC-x64.app\Contents\MacOS
34+
35+
- name: Create arm64 .app
36+
run: cp -r .\macOS Templates\MultiRPC.app .\macOS Templates\MultiRPC-arm64.app && cp -r .\src\MultiRPC\bin\Release\net6.0\osx-arm64\publish\ .\macOS Templates\MultiRPC-arm64.app\Contents\MacOS
37+
38+
- uses: actions/upload-artifact@v2
39+
with:
40+
name: MultiRPC-arm64.app
41+
path: .\macOS Templates\MultiRPC-arm64.app
42+
43+
- uses: actions/upload-artifact@v2
44+
with:
45+
name: MultiRPC-x64.app
46+
path: .\macOS Templates\MultiRPC-x64.app

0 commit comments

Comments
 (0)