Merge pull request #52 from akarboush/main #233
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
name: everything | |
on: [ push, pull_request ] | |
jobs: | |
test: | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, windows-latest ] | |
framework: [ 'net8.0', 'net6.0' ] | |
include: | |
- os: windows-latest | |
framework: net48 | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: | | |
6.0.x | |
8.0.x | |
- name: Run tests (${{ matrix.framework }}) | |
run: dotnet test --configuration Release --framework ${{ matrix.framework }} --results-directory test-results --settings test.runsettings | |
- name: Publish coverage | |
uses: codecov/codecov-action@v4 | |
with: | |
directory: ./test-results/ | |
token: ${{ secrets.CODECOV_TOKEN }} | |
package: | |
needs: test | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: | | |
6.0.x | |
8.0.x | |
- name: Create packages (w/o version suffix) | |
run: dotnet pack --configuration Release --include-symbols --property:PackageOutputPath=${{ runner.temp }}\pkg | |
if: startsWith(github.ref, 'refs/tags/v') == true | |
- name: Create packages (w/ version suffix) | |
run: dotnet pack --configuration Release --include-symbols --version-suffix preview.${{ github.run_number }} --property:PackageOutputPath=${{ runner.temp }}\pkg | |
if: startsWith(github.ref, 'refs/tags/v') != true | |
- name: Upload packages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: packages | |
path: ${{ runner.temp }}\pkg | |
if: github.event_name == 'push' | |
prerelease: | |
needs: package | |
runs-on: windows-latest | |
steps: | |
- name: Download packages | |
uses: actions/download-artifact@v4 | |
with: | |
name: packages | |
- name: Publish packages | |
run: dotnet nuget push *.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json | |
if: github.ref == 'refs/heads/main' | |
release: | |
needs: package | |
runs-on: windows-latest | |
steps: | |
- name: Download packages | |
uses: actions/download-artifact@v4 | |
with: | |
name: packages | |
- name: Publish packages | |
run: dotnet nuget push *.nupkg --api-key ${{ secrets.NUGET_TOKEN }} --skip-duplicate --source nuget.org | |
if: startsWith(github.ref, 'refs/tags/v') == true |