diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 05ff857..3d70b79 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -27,5 +27,25 @@ jobs: - 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 'github-actions@github.com' + + - 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 pack --configuration Release --no-restore + run: dotnet nuget push ./PrsianDate/bin/Release/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json