build: simplify build matrix #7
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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/setup-msbuild@v1.1 | ||
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. | ||
steps: | ||
- 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: nuget push ./artifacts/packages/*.nupkg -Source 'https://api.nuget.org/v2/index.json' -ApiKey ${{secrets.NUGET_API_KEY}} | ||
if: ${{ steps.release.outputs.release_created }} | ||