Skip to content

Commit 9f3b6bd

Browse files
authored
Merge pull request #13 from magic5644/feature-add-macos-build
Feature add macos build
2 parents 9a2facf + 47bc261 commit 9f3b6bd

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

.github/workflows/dotnet.yml

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
branches: ["main"]
1111

1212
jobs:
13+
1314
build:
1415
runs-on: ubuntu-latest
1516

.github/workflows/publish.yml

+16-1
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ jobs:
88
name: Release
99
strategy:
1010
matrix:
11-
kind: ["linux", "windows"]
11+
kind: ["linux", "windows", "macos"]
1212
include:
1313
- kind: linux
1414
os: ubuntu-latest
1515
target: linux-x64
1616
- kind: windows
1717
os: windows-latest
1818
target: win-x64
19+
- kind: macos
20+
os: macos-latest
21+
target: osx-x64
1922
runs-on: ${{ matrix.os }}
2023

2124
steps:
@@ -26,6 +29,18 @@ jobs:
2629
uses: actions/setup-dotnet@v4
2730
with:
2831
dotnet-version: 8.0.x
32+
33+
- name: Build on MacOS
34+
if: matrix.kind == 'macos'
35+
run: |
36+
tag=$(git describe --tags --abbrev=0)
37+
release_name="CodeLineCounter-$tag-${{ matrix.target }}"
38+
39+
dotnet publish CodeLineCounter/CodeLineCounter.csproj --framework net8.0 --runtime "${{ matrix.target }}" -c Release -o "$release_name" /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true /p:UseAppHost=true
40+
41+
zip -r "$release_name.zip" "$release_name"
42+
43+
rm -r "$release_name"
2944
3045
- name: Build on Linux
3146
if: matrix.kind == 'linux'

0 commit comments

Comments
 (0)