From 6562b63d1c8f12cf35d61d4d05acd4d3f8093ce4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B0=D0=B2=D0=B5=D0=BB=20=D0=96=D1=83=D0=BA=D0=BE?= =?UTF-8?q?=D0=B2?= <33721692+LeaveMyYard@users.noreply.github.com> Date: Sun, 28 May 2023 13:38:15 +0300 Subject: Fix set version for Windows --- .github/workflows/build-on-release.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to '.github') diff --git a/.github/workflows/build-on-release.yml b/.github/workflows/build-on-release.yml index f4abc61..9c619e3 100644 --- a/.github/workflows/build-on-release.yml +++ b/.github/workflows/build-on-release.yml @@ -61,10 +61,22 @@ jobs: mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles - - name: Set version in code + - name: Set version in code (Unix) + if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest' run: | awk 'NR==3{$0="__version__\"'${{ github.ref_name }}'\""}1' ./robusta_krr/__init__.py > temp && mv temp ./robusta_krr/__init__.py + - name: Set version in code (Windows) + if: matrix.os == 'windows-latest' + run: | + $content = Get-Content -Path .\robusta_krr\__init__.py + $content[2] = "__version__=`"$($env:GITHUB_REF_NAME)`"" + $content | Out-File -FilePath .\robusta_krr\__init__.py -Encoding ascii + shell: pwsh + env: + GITHUB_REF_NAME: ${{ github.ref_name }} + + - name: Build with PyInstaller shell: bash run: | -- cgit v1.2.3