Skip to content

Commit 95075a3

Browse files
committed
Add github release workflow
1 parent 0be692d commit 95075a3

1 file changed

Lines changed: 68 additions & 0 deletions

File tree

.github/workflows/build.yaml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Build & Release
2+
3+
on:
4+
release:
5+
types: [ published ]
6+
7+
jobs:
8+
build:
9+
name: Build
10+
runs-on: windows-latest
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
with:
16+
submodules: 'recursive'
17+
18+
- name: Setup dotnet
19+
uses: actions/setup-dotnet@v3
20+
with:
21+
dotnet-version: 8.x
22+
dotnet-quality: ga
23+
24+
- name: Install OpenVR Dependencies
25+
shell: cmd
26+
run: |
27+
call cd EasyOpenVR
28+
call download_openvr_api_dependencies.cmd
29+
30+
- name: Install dependencies
31+
run: dotnet restore
32+
33+
- name: Build
34+
run: dotnet build OpenVRStartup/OpenVRStartup.csproj --configuration Release --runtime win-x64
35+
36+
- name: Publish
37+
run: dotnet publish OpenVRStartup/OpenVRStartup.csproj --no-build --configuration Release -o release
38+
39+
- name: Zip release build
40+
shell: bash
41+
run: |
42+
7z a -tzip "OpenVRStartup_${{github.event.release.tag_name}}.zip" "./release/*"
43+
44+
- name: Upload release artifact
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: release
48+
path: OpenVRStartup_${{github.event.release.tag_name}}.zip
49+
50+
release:
51+
name: Upload Release
52+
runs-on: ubuntu-latest
53+
needs: build
54+
55+
steps:
56+
- name: Download artifact
57+
uses: actions/download-artifact@v4
58+
with:
59+
name: release
60+
61+
- name: Display structure of downloaded files
62+
run: ls -R .
63+
64+
- name: Upload file to release
65+
uses: softprops/action-gh-release@v2
66+
with:
67+
files: |
68+
**/*.zip

0 commit comments

Comments
 (0)