Skip to content

Commit e66a86e

Browse files
committed
Add github workflow
1 parent b4a2d40 commit e66a86e

1 file changed

Lines changed: 85 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
tags:
8+
- 'v*'
9+
workflow_dispatch:
10+
11+
jobs:
12+
build-windows:
13+
runs-on: windows-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Cache .NET packages
21+
uses: actions/cache@v4
22+
with:
23+
path: ~/.nuget/packages
24+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
25+
restore-keys: ${{ runner.os }}-nuget-
26+
27+
- name: Run NUKE
28+
run: ./build.ps1 PublishWindows PublishWindowsFrameworkDependent
29+
30+
- name: Upload Windows Artifacts
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: artifacts-windows
34+
path: artifacts/windows*/**/*
35+
retention-days: 7
36+
37+
build-macos:
38+
runs-on: macos-latest
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@v4
42+
with:
43+
fetch-depth: 0
44+
45+
- name: Cache .NET packages
46+
uses: actions/cache@v4
47+
with:
48+
path: ~/.nuget/packages
49+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
50+
restore-keys: ${{ runner.os }}-nuget-
51+
52+
- name: Install create-dmg
53+
run: brew install create-dmg
54+
55+
- name: Run NUKE
56+
run: ./build.sh PublishMacOS PublishMacOSFrameworkDependent CreateMacOSDmg
57+
58+
- name: Upload macOS Artifacts
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: artifacts-macos
62+
path: artifacts/macos*/**/*
63+
retention-days: 7
64+
65+
release:
66+
needs: [build-windows, build-macos]
67+
if: startsWith(github.ref, 'refs/tags/v')
68+
runs-on: ubuntu-latest
69+
permissions:
70+
contents: write
71+
72+
steps:
73+
- name: Download all artifacts
74+
uses: actions/download-artifact@v4
75+
with:
76+
path: artifacts
77+
78+
- name: Create Release
79+
uses: softprops/action-gh-release@v2
80+
with:
81+
files: artifacts/**/*
82+
draft: false
83+
prerelease: false
84+
env:
85+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)