v0.4.0 #8
Workflow file for this run
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
# WARNING: This file is automatically generated by ../regenerate-actions.sh | |
name: Release | |
on: | |
release: | |
types: | |
- published | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build: | |
name: Build & Release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: '0' | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 6.x | |
- name: Setup NuGet | |
run: | | |
dotnet nuget update source github --store-password-in-clear-text --username AshleighAdams --password ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
dotnet nuget enable source github | |
- name: Setup Verlite | |
run: | | |
verlite_version="$(grep '"Verlite\.MsBuild"' Directory.Build.props | LC_ALL=en_US.utf8 grep -Po 'Version="\K[^"]+')" | |
dotnet tool install --global Verlite.CLI --version "$verlite_version" | |
verlite . --auto-fetch --verbosity verbatim | |
- name: Verify Tag | |
run: | | |
[[ "v$(verlite .)" == "${GITHUB_REF#refs/*/}" ]] # error out if the versions don't match | |
- name: Restore | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --configuration Release --no-restore | |
- name: Test | |
run: dotnet test --configuration Debug --logger GitHubActions -p:CollectCoverage=true | |
-p:CoverletOutputFormat=cobertura | |
- name: Pack | |
run: dotnet pack -o artifacts --configuration Release --no-restore | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: artifacts | |
path: | | |
artifacts/* | |
- name: Upload Release | |
run: | | |
set -x | |
tag="${GITHUB_REF#refs/*/}" | |
files=() | |
IFS=$'\n'; | |
for asset in $(find ./artifacts -name "*.nupkg"); do | |
files+=("$asset") | |
done | |
gh release upload "$tag" "${files[@]}" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish Nuget | |
run: | | |
dotnet nuget push 'artifacts/*.nupkg' -k ${NUGETORG_TOKEN} -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols | |
dotnet nuget push 'artifacts/*.nupkg' -k ${GITHUB_TOKEN} -s github --skip-duplicate --no-symbols | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NUGETORG_TOKEN: ${{ secrets.NUGETORG_TOKEN }} |