-
-
Notifications
You must be signed in to change notification settings - Fork 300
65 lines (57 loc) · 1.87 KB
/
main.yaml
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
# The 'main' workflow is used to create the 'Release Please' pull
# request. This PR is opened when we have a new commit to main.
# See:
# https://github.com/googleapis/release-please
name: main
on:
push:
branches:
- main
jobs:
main:
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Add MSBuild to PATH
uses: microsoft/[email protected]
with:
vs-version: 17.3
msbuild-architecture: x64
# Before building, restore Nuget packages and install dependencies.
- name: Install Dependencies
run: |
nuget restore source/SharpGL/SharpGL.sln
./source/SharpGL/config.ps1
# Use our own build script as it hides some unneeded warnings.
- name: Build
run: |
./source/SharpGL/build.ps1
./source/SharpGL/pack.ps1
# Test and upload coverage reports.
- name: Test
run: |
./source/SharpGL/test.ps1
./source/SharpGL/coverage.ps1
# Upload the artifacts folder.
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: artifacts
path: |
./source/SharpGL/artifacts/
# Now that we know the build runs, create a release PR if needed.
- uses: google-github-actions/release-please-action@v3
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: simple
package-name: sharpgl
extra-files: |
source/SharpGL/SharedAssemblyInfo.cs
# If we are building a release (i.e. we've merged from release-please) then
# we can deploy.
- name: Publish
run: dotnet nuget push ./source/SharpGL/artifacts/packages/*.nupkg --source 'https://api.nuget.org/v3/index.json' --api-key ${{secrets.NUGET_API_KEY}}
shell: bash # bash for globs in commmand above...
if: ${{ steps.release.outputs.release_created }}