Skip to content

Commit f75b654

Browse files
authored
Merge pull request #77 from SlimeVR/sapphire/fix-ci-win-zip-name
Rework build workflow to upload correct zip name + not duplicate release notes
2 parents ecf342f + 5b6ab47 commit f75b654

1 file changed

Lines changed: 37 additions & 26 deletions

File tree

.github/workflows/c-cpp.yml

Lines changed: 37 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
name: SlimeVR OpenVR Driver
1+
name: Build and test OpenVR driver
22

33
on: [ push, pull_request, workflow_dispatch ]
44

55
jobs:
66
build:
7-
8-
name: Build for ${{ matrix.os }}
7+
name: Build (${{ matrix.os }})
98
runs-on: ${{ matrix.os }}
109
strategy:
1110
fail-fast: false
@@ -14,10 +13,12 @@ jobs:
1413
include:
1514
- os: windows-latest
1615
triplet: x64-windows-static-md
16+
name: win64
1717
target: ALL_BUILD
1818
release_dir: Release # dir of driver binaries within env.CMAKE_BUILD_DIR, VS multi-config uses <CONFIG>/ subfolder
1919
- os: ubuntu-latest
2020
triplet: x64-linux
21+
name: x64-linux
2122
target: all
2223
release_dir: "" # makefile single config won't have subfolder
2324
env:
@@ -68,32 +69,20 @@ jobs:
6869
- name: Build
6970
run: cmake --build "${{env.CMAKE_BUILD_DIR}}" --config Release --target "${{ matrix.target }}" -j 6 --
7071

71-
- name: Upload a build artifact
72+
- name: Upload driver
7273
uses: actions/upload-artifact@v7
7374
with:
74-
# Artifact name
75-
name: slimevr-openvr-driver-${{ matrix.triplet }} # optional, default is artifact
76-
# A file, directory or wildcard pattern that describes what to upload
77-
# Using wildcards so that only the driver directory gets included (if you specify it, then it won't be included)
78-
path: |
79-
${{env.CMAKE_BUILD_DIR}}/${{ matrix.release_dir }}/driver/*
80-
${{env.CMAKE_BUILD_DIR}}/${{ matrix.release_dir }}/tests*
75+
name: slimevr-openvr-driver-${{ matrix.name }}
76+
path: ${{ env.CMAKE_BUILD_DIR }}/${{ matrix.release_dir }}/driver
8177

82-
- name: Zip
83-
if: startsWith(github.ref, 'refs/tags/')
84-
working-directory: ${{env.CMAKE_BUILD_DIR}}/${{ matrix.release_dir }}/driver
85-
run: cmake -E tar "cf" "${{env.CMAKE_BUILD_DIR}}/slimevr-openvr-driver-${{ matrix.triplet }}.zip" --format=zip -- ${{env.CMAKE_BUILD_DIR}}/${{ matrix.release_dir }}/driver/slimevr
86-
87-
- name: Upload to draft release
88-
uses: softprops/action-gh-release@v3
89-
if: startsWith(github.ref, 'refs/tags/')
78+
- name: Upload tests
79+
uses: actions/upload-artifact@v7
9080
with:
91-
draft: true
92-
generate_release_notes: true
93-
files: "${{env.CMAKE_BUILD_DIR}}/slimevr-openvr-driver-${{ matrix.triplet }}.zip"
81+
name: tests-${{ matrix.name }}
82+
path: ${{ env.CMAKE_BUILD_DIR }}/${{ matrix.release_dir }}/tests*
9483

9584
test:
96-
name: Run tests
85+
name: Run tests (${{ matrix.os }})
9786
needs: build
9887
runs-on: ${{ matrix.os }}
9988
strategy:
@@ -103,15 +92,17 @@ jobs:
10392
include:
10493
- os: windows-latest
10594
triplet: x64-windows-static-md
106-
target: RUN_TESTS
95+
name: win64
96+
target: ALL_BUILD
10797
- os: ubuntu-latest
10898
triplet: x64-linux
109-
target: test
99+
name: x64-linux
100+
target: all
110101
steps:
111102
- name: Download build artifact
112103
uses: actions/download-artifact@v8
113104
with:
114-
name: slimevr-openvr-driver-${{ matrix.triplet }}
105+
name: tests-${{ matrix.name }}
115106
path: ${{ github.workspace }}
116107
- if: matrix.os == 'windows-latest'
117108
name: Run tests on Windows
@@ -121,3 +112,23 @@ jobs:
121112
name: Run tests on Unix
122113
working-directory: ${{ github.workspace }}/
123114
run: chmod +x ./tests && ./tests
115+
116+
upload-release:
117+
name: Upload draft release
118+
needs: [build, test]
119+
if: startsWith(github.ref, 'refs/tags/')
120+
runs-on: ubuntu-latest
121+
steps:
122+
- name: Download driver artifacts
123+
uses: actions/download-artifact@v8
124+
with:
125+
path: ${{ github.workspace }}
126+
pattern: slimevr-openvr-driver-*
127+
merge-multiple: true
128+
skip-decompress: true
129+
130+
- uses: softprops/action-gh-release@v3
131+
with:
132+
draft: true
133+
generate_release_notes: true
134+
files: slimevr-openvr-driver-*.zip

0 commit comments

Comments
 (0)