Skip to content

update release action #71

update release action

update release action #71

Workflow file for this run

name: release
on:
push:
tags:
- "v*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup dotnet 6.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: "6.0.x"
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Setup dotnet 7.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: "7.0.x"
- name: Setup dotnet 8.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: "8.0.x"
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: restore
run: dotnet restore
- uses: nowsprinting/check-version-format-action@v3
id: version
with:
prefix: 'v'
- name: Build
run: dotnet build
- name: Test
run: dotnet test
- name: Publish the application binaries (.net6)
run: dotnet publish ./src/NuGetUtility/NuGetUtility.csproj -c Release --no-restore -o ./artifacts/net6 -f net6.0 -p:Version=${{ steps.version.outputs.full_without_prefix }}
- name: Publish the application binaries (.net7)
run: dotnet publish ./src/NuGetUtility/NuGetUtility.csproj -c Release --no-restore -o ./artifacts/net7 -f net7.0 -p:Version=${{ steps.version.outputs.full_without_prefix }}
- name: Publish the application binaries (.net8)
run: dotnet publish ./src/NuGetUtility/NuGetUtility.csproj -c Release --no-restore -o ./artifacts/net8 -f net8.0 -p:Version=${{ steps.version.outputs.full_without_prefix }}
- name: Create nuget package
run: dotnet pack ./src/NuGetUtility/NuGetUtility.csproj -c Release --no-build -o ./artifacts -p:Version=${{ steps.version.outputs.full_without_prefix }}
- name: Zip artifacts
uses: tomchavakis/[email protected]
with:
args: zip -qq -r ./release.zip ./artifacts
- name: Release
uses: softprops/action-gh-release@v1
with:
prerelease: true
files: |
release.zip
- name: publish nuget package to nuget.org
id: publish_nuget
run: dotnet nuget push ./artifacts/*.nupkg -s 'https://api.nuget.org/v3/index.json' -k ${{secrets.NUGET_KEY}} --skip-duplicate