Skip to content

ci: fix release

ci: fix release #162

Workflow file for this run

name: build
on:
push:
branches:
- master
pull_request:
env:
DOTNET_NOLOGO: true
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 2
filter: blob:none # We don't need all blobs
- uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets') }}
- name: restore
run: dotnet restore
- name: build
run: dotnet build --no-restore ./MimeMapping.sln
- name: test
run: dotnet test --no-build ./MimeMapping.sln
- name: Codecov
uses: codecov/codecov-action@e0b68c6749509c5f83f984dd99a76a1c1a231044 # v4.0.1
with:
files: '**/TestResults/*/*.cobertura.xml'
token: ${{ secrets.CODECOV_TOKEN }}
build:
needs: [test]
runs-on: windows-latest
timeout-minutes: 15
env:
CONFIGURATION: Release
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0 # needed so minver finds git tags https://github.com/actions/checkout/issues/172
filter: blob:none # We don't need all blobs
- uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets') }}
- name: restore
run: dotnet restore
- name: build
run: dotnet build --no-restore
- name: pack
run: dotnet pack -o bin
- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: packages
path: bin/*.nupkg