Skip to content

Bump actions/upload-artifact from 3 to 4 #309

Bump actions/upload-artifact from 3 to 4

Bump actions/upload-artifact from 3 to 4 #309

Workflow file for this run

name: CI
on: [push, pull_request]
permissions:
actions: write
contents: write
jobs:
build:
name: .NET on ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Build
run: dotnet build -c Release ValveKeyValue/ValveKeyValue.sln
- name: Test
run: dotnet test -c Release ValveKeyValue/ValveKeyValue.Test/ValveKeyValue.Test.csproj /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:CoverletOutput='./lcov.info' /p:Include="[ValveKeyValue*]*"
- name: Create nupkg
run: dotnet pack --configuration Release ValveKeyValue/ValveKeyValue/ValveKeyValue.csproj
- name: Upload nupkg
uses: actions/upload-artifact@v4
if: matrix.os == 'ubuntu-latest'
with:
name: nupkg
path: 'ValveKeyValue/ValveKeyValue/bin/Release/*.nupkg'
- name: Upload test coverage
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./ValveKeyValue/ValveKeyValue.Test/lcov.info
fail_ci_if_error: true
verbose: true
release:
if: startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Display artifacts folder structure
run: ls -Rl
working-directory: artifacts
- name: Create release
uses: softprops/action-gh-release@v1
with:
draft: true
files: artifacts/nupkg/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}