fix: migrate window focus from PowerShell to C# FocusGuard with STA t… #18
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 Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| jobs: | |
| release: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout do código | |
| uses: actions/checkout@v4 | |
| - name: Atualizar versão no extension.yaml | |
| run: | | |
| $version = "${{ github.ref_name }}".TrimStart("v") | |
| (Get-Content extension.yaml) -replace '^Version:.*', "Version: $version" | | |
| Set-Content extension.yaml | |
| - name: Compilar projeto | |
| run: dotnet build GameTaskPlugin.csproj -c Release | |
| - name: Criar o .pext | |
| id: pext | |
| run: | | |
| $version = "${{ github.ref_name }}".TrimStart("v") | |
| $pextName = "GameTask-$version.pext" | |
| Compress-Archive -Force -Path @( | |
| "bin\Release\net48\GameTaskPlugin.dll", | |
| "extension.yaml", | |
| "icon.png" | |
| ) -DestinationPath "tmp.zip" | |
| Rename-Item -Path "tmp.zip" -NewName $pextName | |
| echo "PEXT_NAME=$pextName" >> $env:GITHUB_OUTPUT | |
| - name: Extrair notas do CHANGELOG | |
| id: changelog | |
| run: | | |
| $tag = "${{ github.ref_name }}" | |
| $content = Get-Content CHANGELOG.md -Raw | |
| # Captura o bloco entre o cabeçalho da tag atual e o próximo cabeçalho ## | |
| $pattern = "(?s)##\s*\[$tag\][^\n]*\n(.+?)(?=\n## \[|$)" | |
| $match = [regex]::Match($content, $pattern) | |
| if ($match.Success) { | |
| $notes = $match.Groups[1].Value.Trim() | |
| } else { | |
| $notes = "See CHANGELOG.md for details." | |
| } | |
| # Salva em arquivo para evitar problemas com caracteres especiais | |
| Set-Content -Path "release_notes.md" -Value $notes -Encoding UTF8 | |
| echo "NOTES_FILE=release_notes.md" >> $env:GITHUB_OUTPUT | |
| - name: Publicar Release no GitHub | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: ${{ steps.pext.outputs.PEXT_NAME }} | |
| body_path: ${{ steps.changelog.outputs.NOTES_FILE }} |