Merge pull request #8 from hootanht/update-version-1 #4
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: CD | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '8.0.x' | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build solution | |
run: dotnet build --configuration Release --no-restore | |
- name: Run tests | |
run: dotnet test --no-restore --verbosity normal | |
- name: Set up Git | |
run: | | |
git config --global user.name 'github-actions' | |
git config --global user.email '[email protected]' | |
- name: Determine version number | |
id: get_version | |
run: echo "::set-output name=version::$(dotnet run --project ./PrsianDate/PrsianDate.csproj --configuration Release --no-build --no-restore)" | |
- name: Create GitHub release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ steps.get_version.outputs.version }} | |
release_name: Release ${{ steps.get_version.outputs.version }} | |
draft: false | |
prerelease: false | |
- name: Publish NuGet package | |
run: dotnet nuget push ./PrsianDate/bin/Release/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json |