Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #60
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 | |
on: | |
push: | |
pull_request: | |
branches: [ master ] | |
release: | |
types: | |
- published | |
env: | |
# Project namespace | |
PROJECT_NAMESPACE: "AspNetCore.CongestionControl" | |
UNIT_TEST_NAMESPACE: "AspNetCore.CongestionControl.UnitTests" | |
INTEGRATION_TEST_NAMESPACE: "AspNetCore.CongestionControl.IntegrationTests" | |
# Official NuGet Feed settings | |
NUGET_FEED: https://api.nuget.org/v3/index.json | |
NUGET_KEY: ${{ secrets.NUGET_KEY }} | |
jobs: | |
prepare: | |
name: Prepare | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup .NET on CI runner | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 3.1.301 | |
build: | |
needs: prepare | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Restore | |
run: dotnet restore | |
- name: Build | |
run: dotnet build -c Release --no-restore | |
- name: Unit Test | |
id: unit-test-coverage | |
run: | | |
dotnet test ./test/$UNIT_TEST_NAMESPACE/$UNIT_TEST_NAMESPACE.csproj -c Release --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=lcov | |
echo "::set-output name=COVERAGE_FILE::$(find ./test/$UNIT_TEST_NAMESPACE -name 'coverage.info' -print)" | |
- name: Publish Coverage Report to coveralls.io | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: ${{ steps.unit-test-coverage.outputs.COVERAGE_FILE }} | |
- name: Start Redis | |
uses: supercharge/[email protected] | |
- name: Integration Test | |
run: dotnet test ./test/$INTEGRATION_TEST_NAMESPACE/$INTEGRATION_TEST_NAMESPACE.csproj -c Release --no-build | |
- name: Version | |
id: version | |
uses: hennejg/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Package | |
if: github.event_name == 'release' | |
env: | |
RELEASE_VERSION: ${{ steps.version.outputs.previous_tag }} | |
run: | | |
RELEASE_VERSION=${RELEASE_VERSION#?} | |
dotnet pack -v normal -c Release -o nupkg --no-restore --include-symbols --include-source -p:PackageVersion=$RELEASE_VERSION ./src/$PROJECT_NAMESPACE/$PROJECT_NAMESPACE.csproj | |
- name: Upload Artifact | |
if: github.event_name == 'release' | |
uses: actions/upload-artifact@v2 | |
with: | |
name: nupkg | |
path: ./nupkg/*.nupkg | |
publish: | |
needs: build | |
name: Publish | |
runs-on: ubuntu-latest | |
if: github.event_name == 'release' | |
steps: | |
- name: Download Artifact | |
uses: actions/[email protected] | |
with: | |
name: nupkg | |
path: ./nupkg | |
- name: Push to NuGet Feed | |
run: dotnet nuget push ./nupkg/*.nupkg --source $NUGET_FEED --skip-duplicate --api-key $NUGET_KEY |