Skip to content

Create workflow to upload msi to storage account. #5

Create workflow to upload msi to storage account.

Create workflow to upload msi to storage account. #5

name: Build and Package MSI
on:
workflow_dispatch:
# will delete pull request when it's ready
pull_request:
branches:
- main
jobs:
build_msi_installer:
runs-on: windows-latest
name: Build Windows MSI
steps:
- name: Checkout Repo
uses: actions/checkout@v2
with:
submodules: true
- name: Add msbuild to PATH
uses: microsoft/[email protected]
- name: Install Wix Toolset
shell: pwsh
working-directory: ${{ github.workspace }}/scripts/installer/windows
run: |
Invoke-WebRequest -Uri 'https://azurecliprod.blob.core.windows.net/msi/wix310-binaries-mirror.zip' -OutFile 'wix-archive.zip'
Expand-Archive -Path 'wix-archive.zip' -DestinationPath 'wix'
Remove-Item -Path 'wix-archive.zip'
- name: Install Python and dependencies
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install promptflow[azure,executable] promptflow-tools
shell: pwsh
- name: Get promptflow version
id: get-version
run: |
$version=$(python -c "import promptflow; print(promptflow.__version__)")
echo "::set-output name=version::$version"
shell: pwsh
- name: Build Pyinstaller project
working-directory: ${{ github.workspace }}/scripts/installer/windows/scripts
run: |
echo "Version from promptflow: ${{ steps.get-version.outputs.version }}"
$text = Get-Content "version_info.txt" -Raw
$text = $text -replace '\$\((env\.CLI_VERSION)\)', ${{ steps.get-version.outputs.version }}
$text | Out-File -FilePath "version_info.txt" -Encoding utf8
pyinstaller promptflow.spec
shell: pwsh
- name: Build Wix project
working-directory: ${{ github.workspace }}/scripts/installer/windows
run: |
$text = Get-Content "promptflow.wixproj" -Raw
$text = $text -replace '\$\((env\.CLI_VERSION)\)', ${{ steps.get-version.outputs.version }}
$text | Out-File -FilePath "promptflow.wixproj" -Encoding utf8
$text = Get-Content "product.wxs" -Raw
$text = $text -replace '\$\((env\.CLI_VERSION)\)', ${{ steps.get-version.outputs.version }}
$text | Out-File -FilePath "product.wxs" -Encoding utf8
msbuild /t:rebuild /p:Configuration=Release /p:Platform=x64 promptflow.wixproj
shell: pwsh
- name: Upload MSI to Artifact
uses: actions/upload-artifact@v2
with:
name: msi-artifact
path: scripts/installer/windows/out/*.msi