reenable publishing #22
Workflow file for this run
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: Development Build, Integration Test, & Publish | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get Release Version | |
id: getReleaseVersion | |
run: echo tag=${GITHUB_REF#refs/*/v} >> $GITHUB_OUTPUT | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 7.0.x | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore | |
- name: Test | |
run: dotnet test --no-build --verbosity normal | |
- name: Package Nuget | |
run: dotnet pack -p:PackageVersion=${{ steps.getReleaseVersion.outputs.tag }} -o ./output | |
- name: Upload TinyHealthCheck package artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: nuget-package | |
path: ./output/TinyHealthCheck.${{ steps.getReleaseVersion.outputs.tag }}.nupkg | |
publish-package: | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 7.0.x | |
## Checkout so we can apply the new tag | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: "0" | |
- name: Get Release Version | |
id: getReleaseVersion | |
run: echo tag=${GITHUB_REF#refs/*/v} >> $GITHUB_OUTPUT | |
- name: Echo version | |
run: echo ${{ steps.getReleaseVersion.outputs.tag }} | |
- name: Download TinyHealthCheck artifact | |
uses: actions/download-artifact@v3 | |
with: | |
path: ./package | |
name: nuget-package | |
- name: Push Nuget Package | |
run: dotnet nuget push ./package/TinyHealthCheck.${{ steps.getReleaseVersion.outputs.tag }}.nupkg --api-key ${{secrets.NUGET_TOKEN}} --source https://api.nuget.org/v3/index.json | |
# ## Documentation: https://github.com/marvinpinto/action-automatic-releases | |
- uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
prerelease: false |