replaced test vars with BMHS vars #7
This file contains 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: Convert PS1 to EXE | |
on: | |
push: | |
paths: | |
- '**.ps1' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install PS2EXE | |
shell: pwsh | |
run: | | |
Write-Host "Setting PSGallery as Trusted" | |
Set-PSRepository PSGallery -InstallationPolicy Trusted | |
Write-Host "Installing ps2exe module" | |
Install-Module -Name ps2exe -Force -SkipPublisherCheck -Scope CurrentUser | |
- name: Convert PS1 to EXE | |
shell: pwsh | |
run: | | |
Write-Host "Importing ps2exe module" | |
Import-Module ps2exe | |
Write-Host "Converting PS1 files to EXE" | |
Get-ChildItem *.ps1 | ForEach-Object { | |
$exeName = "$($_.BaseName).exe" | |
Write-Host "Converting $($_.FullName) to $exeName" | |
Invoke-ps2exe -InputFile $_.FullName -OutputFile $exeName | |
} | |
- name: Upload EXE | |
uses: actions/upload-artifact@v2 | |
with: | |
name: exe-files | |
path: ./*.exe |