Cleanup code #2
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: Publish Windows Service Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' # Triggers on any tag starting with "v" (e.g., v1.0.0, v2.1.3-beta) | |
| env: | |
| PROJECT_PATH: 'src/Nager.FileCompressService/Nager.FileCompressService.csproj' | |
| jobs: | |
| build-and-release: | |
| runs-on: windows-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v6 | |
| - name: Setup .NET 10 | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Restore Dependencies | |
| run: dotnet restore ${{ env.PROJECT_PATH }} | |
| - name: Publish Application | |
| run: | | |
| dotnet publish ${{ env.PROJECT_PATH }} -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -p:PublishTrimmed=false -o ./publish | |
| - name: Create Release Zip | |
| shell: pwsh | |
| run: | | |
| Compress-Archive -Path ./publish/* -DestinationPath ./Nager.FileCompressService-${{ github.ref_name }}-win-x64.zip | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| files: Nager.FileCompressService-${{ github.ref_name }}-win-x64.zip | |
| draft: false | |
| prerelease: false | |
| generate_release_notes: true # Automatically generates release notes from your commit history | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |