chore: bump version to 0.7.7 #22
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*' | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'Tag to build (e.g., v0.6.1)' | |
| required: true | |
| type: string | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| name: Build Windows Executable | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set version from tag | |
| id: version | |
| shell: pwsh | |
| run: | | |
| if ("${{ github.event_name }}" -eq "workflow_dispatch") { | |
| $tag = "${{ github.event.inputs.tag }}" | |
| } else { | |
| $tag = $env:GITHUB_REF -replace 'refs/tags/', '' | |
| } | |
| $version = $tag -replace '^v', '' | |
| echo "VERSION=$version" >> $env:GITHUB_OUTPUT | |
| echo "TAG=$tag" >> $env:GITHUB_OUTPUT | |
| echo "Building version: $version from event: ${{ github.event_name }}" | |
| - name: Install ps2exe | |
| shell: pwsh | |
| run: | | |
| $ErrorActionPreference = 'Stop' | |
| Write-Host "Installing ps2exe..." | |
| Set-PSRepository PSGallery -InstallationPolicy Trusted | |
| Install-Module ps2exe -Scope CurrentUser -Force | |
| Import-Module ps2exe | |
| Write-Host "ps2exe installed successfully" | |
| Get-Command -Module ps2exe | Format-Table Name, Version | |
| - name: Build EXE | |
| shell: pwsh | |
| run: | | |
| $ErrorActionPreference = 'Stop' | |
| $version = "${{ steps.version.outputs.VERSION }}" | |
| Write-Host "Building version: $version" | |
| Write-Host "Working directory: $(Get-Location)" | |
| Write-Host "Input file exists: $(Test-Path 'bin\win-ops.ps1')" | |
| # Build win-ops.exe with minimal options first | |
| Write-Host "Calling ps2exe..." | |
| ps2exe -inputFile "bin\win-ops.ps1" -outputFile "win-ops.exe" -noConsole -verbose | |
| if (-not (Test-Path "win-ops.exe")) { | |
| Write-Error "❌ Failed to build win-ops.exe" | |
| exit 1 | |
| } | |
| Write-Host "✅ win-ops.exe built successfully" | |
| $size = (Get-Item "win-ops.exe").Length / 1MB | |
| Write-Host "📦 Size: $([math]::Round($size, 2)) MB" | |
| - name: Create Release Archive | |
| shell: pwsh | |
| run: | | |
| # Create release directory | |
| $releaseDir = "win-ops-${{ steps.version.outputs.VERSION }}" | |
| New-Item -ItemType Directory -Path $releaseDir -Force | |
| # Copy files | |
| Copy-Item "win-ops.exe" $releaseDir | |
| Copy-Item "install.ps1" $releaseDir | |
| Copy-Item "uninstall.ps1" $releaseDir | |
| Copy-Item "README.md" $releaseDir | |
| Copy-Item "LICENSE" $releaseDir -ErrorAction SilentlyContinue | |
| Copy-Item -Recurse "config" $releaseDir | |
| Copy-Item -Recurse "lib" $releaseDir | |
| Copy-Item -Recurse "resources" $releaseDir | |
| Copy-Item -Recurse "scheduler" $releaseDir | |
| # Create ZIP | |
| Compress-Archive -Path $releaseDir -DestinationPath "win-ops-${{ steps.version.outputs.VERSION }}-windows-x64.zip" -Force | |
| Write-Host "✅ Release archive created" | |
| - name: Generate Release Notes | |
| id: release_notes | |
| shell: pwsh | |
| run: | | |
| $version = "${{ steps.version.outputs.VERSION }}" | |
| # Simple release notes without complex formatting | |
| "## win-ops v$version" | Out-File -FilePath "RELEASE_NOTES.md" -Encoding UTF8 | |
| "" | Out-File -FilePath "RELEASE_NOTES.md" -Encoding UTF8 -Append | |
| "Windows system cleanup and optimization toolkit." | Out-File -FilePath "RELEASE_NOTES.md" -Encoding UTF8 -Append | |
| "" | Out-File -FilePath "RELEASE_NOTES.md" -Encoding UTF8 -Append | |
| "See the full [README](https://github.com/seunggabi/win-ops#readme) for documentation." | Out-File -FilePath "RELEASE_NOTES.md" -Encoding UTF8 -Append | |
| Write-Host "✅ Release notes generated" | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| name: win-ops ${{ steps.version.outputs.VERSION }} | |
| body_path: RELEASE_NOTES.md | |
| files: | | |
| win-ops.exe | |
| win-ops-${{ steps.version.outputs.VERSION }}-windows-x64.zip | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: win-ops-${{ steps.version.outputs.VERSION }} | |
| path: | | |
| win-ops.exe | |
| win-ops-${{ steps.version.outputs.VERSION }}-windows-x64.zip | |
| retention-days: 90 |