Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #5
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: | |
branches: | |
- master | |
tags: | |
- "*" | |
pull_request: | |
jobs: | |
calculate-version: | |
runs-on: ubuntu-20.04 | |
outputs: | |
version: ${{ steps.version.outputs.version }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@master | |
with: | |
fetch-depth: 0 | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/[email protected] | |
with: | |
versionSpec: "5.8.1" | |
- name: Run GitVersion | |
id: gitversion | |
uses: gittools/actions/gitversion/[email protected] | |
- name: Version | |
id: version | |
run: | | |
version=${{ steps.gitversion.outputs.nuGetVersionV2 }} | |
if [ "${{ github.event_name }}" == "pull_request" ] | |
then | |
version=${version}-${{ steps.gitversion.outputs.shortSha }} | |
fi | |
echo "::set-output name=version::${version}" | |
build: | |
runs-on: ${{ matrix.os }} | |
needs: [calculate-version] | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-20.04 | |
nugetPush: false | |
- os: windows-2019 | |
nugetPush: true | |
- os: macos-10.15 | |
nugetPush: false | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@master | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- name: Setup dotnet SDK | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: "6.0.101" | |
- name: Build | |
run: | | |
dotnet build -c Release -p:Version=${{ needs.calculate-version.outputs.version }} | |
shell: bash | |
- name: Test | |
run: dotnet test -c Release --no-build | |
shell: bash | |
- name: Archive NuGet Packages | |
uses: actions/upload-artifact@v2 | |
if: ${{ matrix.nugetPush }} | |
with: | |
name: packages | |
path: | | |
**/*.nupkg | |
**/*.snupkg | |
retention-days: 1 | |
nuget-push: | |
runs-on: ubuntu-20.04 | |
needs: [build] | |
if: github.event_name != 'pull_request' | |
steps: | |
- name: Download NuGet Packages | |
uses: actions/[email protected] | |
with: | |
name: packages | |
- name: NuGet Push | |
run: dotnet nuget push **/*.nupkg -s https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} |