Skip to content

Release

Release #13

Workflow file for this run

name: Release
on:
workflow_dispatch
jobs:
release:
name: Release
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
7.0.x
8.0.x
- name: Tests
run: dotnet test --configuration Release
- name: Package release
id: package_release
run: |
VERSION=`cat semver.txt`
OUTPUT=${{ runner.temp }}/nupkgs
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "core_package_name=openapi2excel.core.$VERSION.nupkg" >> $GITHUB_OUTPUT
echo "core_package_filename=$OUTPUT/openapi2excel.core.$VERSION.nupkg" >> $GITHUB_OUTPUT
echo "tool_package_name=openapi2excel.cli.$VERSION.nupkg" >> $GITHUB_OUTPUT
echo "tool_package_filename=$OUTPUT/openapi2excel.cli.$VERSION.nupkg" >> $GITHUB_OUTPUT
dotnet build --configuration Release
dotnet pack --configuration Release /p:Version=$VERSION /p:PackageOutputPath=$OUTPUT
- name: Publish package
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: |
dotnet nuget push --source https://api.nuget.org/v3/index.json --api-key "$NUGET_API_KEY" ${{ steps.package_release.outputs.core_package_filename }}
dotnet nuget push --source https://api.nuget.org/v3/index.json --api-key "$NUGET_API_KEY" ${{ steps.package_release.outputs.tool_package_filename }}