adding automated builds #1
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: Build and Package .NET App | |
| on: | |
| push: | |
| tags: | |
| - v* | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.x' # Use latest 10.x preview SDK automatically | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Publish Windows build | |
| run: dotnet publish -c Release -r win-x64 -o publish | |
| - name: Archive build output | |
| run: Compress-Archive -Path publish\* -DestinationPath win-x64.zip | |
| - name: Generate changelog | |
| id: changelog | |
| run: | | |
| $previousTag=$(git describe --tags --abbrev=0 HEAD^ 2>$null || echo "") | |
| if [ -z "$previousTag" ]; then | |
| echo "## Changes since beginning" > RELEASE_NOTES.md | |
| git log --pretty=format:"- %s" >> RELEASE_NOTES.md | |
| else | |
| echo "## Changes since $previousTag" > RELEASE_NOTES.md | |
| git log $previousTag..HEAD --pretty=format:"- %s" >> RELEASE_NOTES.md | |
| fi | |
| echo "notes<<EOF" >> $GITHUB_OUTPUT | |
| cat RELEASE_NOTES.md >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| - name: Upload Release Asset | |
| uses: softprops/action-gh-release@v1 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| files: win-x64.zip | |
| generate_release_notes: true | |
| body: ${{ steps.changelog.outputs.notes }} | |