build: bump download-artifact version, move back to shared runners #95
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
name: Build, Test, Publish | |
on: | |
- push | |
jobs: | |
build: | |
name: Build and Test | |
runs-on: macos-latest | |
env: | |
DOTNET_NOLOGO: true | |
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: true | |
defaults: | |
run: | |
working-directory: src | |
outputs: | |
is-release: ${{ steps.get-version.outputs.is-release }} | |
version: ${{ steps.get-version.outputs.version }} | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
- name: Set version | |
uses: triaxis-oss/dotnet-set-version@v1 | |
id: get-version | |
with: | |
project: src/triaxis.BluetoothLE/triaxis.BluetoothLE.props | |
- name: Install workloads | |
run: | | |
dotnet workload restore triaxis.BluetoothLE.Maui/triaxis.BluetoothLE.Maui.csproj | |
- name: Build | |
run: | | |
dotnet build build.proj | |
- name: Upload Package Artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: packages | |
path: src/packages/**/*nupkg | |
- name: Test | |
run: dotnet test triaxis.BluetoothLE.Tests -c Release -v Normal -l "junit;logFilePath=test-results.xml" | |
- name: Upload Test Artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: test-results | |
path: src/**/test-results.xml | |
publish-test-results: | |
name: Publish test results | |
runs-on: macos-latest | |
needs: build | |
steps: | |
- name: Fetch Test Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: test-results | |
path: ${{runner.temp}}/res | |
- name: Publish Test Results | |
uses: enricomi/publish-unit-test-result-action/composite@v1 | |
if: always() | |
with: | |
files: ${{runner.temp}}/res/**/test-results.xml | |
publish-nuget: | |
name: Publish NuGet | |
runs-on: macos-latest | |
env: | |
DOTNET_NOLOGO: true | |
needs: build | |
steps: | |
- name: Fetch Package Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: packages | |
path: ${{runner.temp}}/packages | |
- name: Publish NuGet Packages | |
if: needs.build.outputs.is-release == 'true' | |
run: dotnet nuget push ${{runner.temp}}/packages/*.nupkg -s nuget.org -k ${{secrets.NUGET_API_KEY}} --skip-duplicate | |
- name: Publish GitHub Packages | |
if: needs.build.outputs.is-release != 'true' | |
run: dotnet nuget push ${{runner.temp}}/packages/single/*.nupkg -s https://${{github.actor}}@nuget.pkg.github.com/${{github.repository_owner}} -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate |