Release #17
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: Release | |
on: | |
workflow_dispatch | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- 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: Read version from file | |
id: version | |
run: echo "VERSION=$(cat semver.txt)" >> $GITHUB_ENV | |
- name: Package release | |
id: package_release | |
run: | | |
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 /p:Version=$VERSION | |
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 }} |