Skip to content

Commit

Permalink
Merge pull request #7 from hootanht/add-cd-pipeline
Browse files Browse the repository at this point in the history
Add CD pipeline
  • Loading branch information
hootanht authored Sep 12, 2024
2 parents c16e41e + c9b2d5e commit 6d2e68e
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 '[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 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

0 comments on commit 6d2e68e

Please sign in to comment.