Skip to content

Snapshooter xunit3 (#211) #2

Snapshooter xunit3 (#211)

Snapshooter xunit3 (#211) #2

Workflow file for this run

name: Release
on:
push:
tags:
- "*"
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Use .NET SDK from global.json
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
8
9
- name: Extract package version
run: echo "PACKAGE_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
shell: bash
- name: Extract assembly version
run: echo "ASSEMBLY_VERSION=$(echo ${{ github.ref_name }} | grep -o '^[0-9]*\.[0-9]*\.[0-9]*').0" >> $GITHUB_ENV
shell: bash
- name: Build projects
run: |
for sln in $(find . -name '*.sln'); do
echo -e "\n\033[0;34mBuilding $sln \033[0m"
dotnet build "$sln" -c Release /p:Version=${{ env.PACKAGE_VERSION }} /p:AssemblyVersion=${{ env.ASSEMBLY_VERSION }} /p:FileVersion=${{ env.ASSEMBLY_VERSION }}
done
shell: bash
- name: Pack
run: find . -name '*.sln' | parallel --jobs 0 'dotnet pack {} /p:PackageVersion=${{env.PACKAGE_VERSION}} -c Release -o ./out --no-build --include-symbols --include-source --verbosity Minimal'
shell: bash
- name: Push
run: |
find . -name '*.nupkg' | grep -v '.sources.nupkg' | parallel --jobs 0 'dotnet nuget push {} --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json'
shell: bash