Merge pull request #9 from voltaney/doc/fix-readme #4
Workflow file for this run
This file contains hidden or 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 Packages | |
| on: | |
| push: | |
| tags: | |
| - "v[0-9]+.[0-9]+.[0-9]+" | |
| jobs: | |
| release-packages: | |
| permissions: | |
| contents: write | |
| runs-on: windows-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Verify commit exists in origin/main | |
| run: | | |
| git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* | |
| git branch --remote --contains | grep origin/main | |
| - name: Set VERSION variable from tag | |
| run: | | |
| $version = "${{ github.ref_name }}" -replace '^v', '' | |
| echo "VERSION=$version" >> $env:GITHUB_ENV | |
| - name: Build | |
| run: dotnet build --configuration Release -p:Version=$env:VERSION | |
| - name: Test | |
| run: dotnet test --configuration Release -p:Version=$env:VERSION --no-build | |
| - name: Create the package | |
| run: dotnet pack --configuration Release "./TouchSenderInterpreter" -p:Version=$env:VERSION -o nupkgs | |
| - name: Upload release artifacts | |
| run: gh release upload "${{ github.ref_name }}" ./nupkgs/*.nupkg | |
| # for using wildcards | |
| shell: bash | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Publish the package to nuget.org | |
| run: dotnet nuget push ./nupkgs/*.nupkg -k $NUGET_AUTH_TOKEN -s https://api.nuget.org/v3/index.json | |
| shell: bash | |
| env: | |
| NUGET_AUTH_TOKEN: ${{ secrets.NUGET_TOKEN }} |