generated from MaxGripe/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (72 loc) · 2.18 KB
/
dotnet.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: .NET Build and Release
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
jobs:
build-windows:
name: Build on Windows
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Build for Windows
run: |
dotnet publish --runtime win-x64 -c Release -o "output/win-x64"
- name: Upload Windows Artifact
uses: actions/upload-artifact@v4
with:
name: win-x64-artifact
path: output/win-x64/koji-stream-player.exe
build-macos:
name: Build on macOS
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Build for macOS
run: |
dotnet publish --runtime osx-arm64 -c Release -o "output/osx-arm64"
- name: Ad-hoc Code Signing
run: |
codesign --deep --force --verify --sign - output/osx-arm64/koji-stream-player
- name: Upload macOS Artifact
uses: actions/upload-artifact@v4
with:
name: osx-arm64-artifact
path: output/osx-arm64/koji-stream-player
create-release:
name: Create GitHub Release and Upload Artifacts
runs-on: ubuntu-latest
needs: [build-windows, build-macos]
steps:
- name: Download Windows Artifact
uses: actions/download-artifact@v4
with:
name: win-x64-artifact
path: output/win-x64/
- name: Download macOS Artifact
uses: actions/download-artifact@v4
with:
name: osx-arm64-artifact
path: output/osx-arm64/
- name: Create GitHub Release and Upload Artifacts
uses: softprops/action-gh-release@v2
with:
tag_name: "latest-${{ github.sha }}"
name: "Auto-release"
files: |
output/win-x64/koji-stream-player.exe
output/osx-arm64/koji-stream-player
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}