Update release.yml to save a zip of the address file and the version #17
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 Powershell Executable | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'powershell/*' | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| jobs: | |
| build-and-publish: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Install PS2EXE module | |
| shell: pwsh | |
| run: | | |
| Set-PSRepository PSGallery -InstallationPolicy Trusted | |
| Install-Module -Name PS2EXE -Force -SkipPublisherCheck | |
| - name: Convert PowerShell script to an Executable | |
| shell: pwsh | |
| run: | | |
| $scriptFile = 'powershell/geocoder_for_exe.ps1' | |
| $outputExe = 'geocoder.exe' | |
| Invoke-ps2exe -inputFile $scriptFile -outputFile $outputExe -noConsole:$false | |
| - name: Save Release Info | |
| shell: pwsh | |
| run: | | |
| $version = "${{ github.ref_name }}" | |
| $version | Out-File -FilePath "release.txt" -Encoding UTF8 -NoNewline | |
| Write-Host "Created release.txt with version: $version" | |
| - name: Create Release ZIP | |
| shell: pwsh | |
| run: | | |
| $version = "${{ github.ref_name }}" | |
| $zipName = "geocoder-$version.zip" | |
| Compress-Archive -Path geocoder.exe, release.txt -DestinationPath $zipName | |
| Write-Host "Created $zipName" | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| if: github.ref_type == 'tag' | |
| with: | |
| files: geocoder-${{ github.ref_name }}.zip | |
| draft: false | |
| prerelease: false | |
| generate_release_notes: true | |
| body_path: powershell/USER_GUIDE.md | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |