diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 1f60a3a..0a155f1 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -66,11 +66,26 @@ jobs: pip install -r requirements.txt pip install pyinstaller - - name: Inject commit hash into code + - name: Generate version + id: version run: | - echo '{' > build_info.json - echo " \"version\": \"${GITHUB_SHA}\"" >> build_info.json - echo '}' >> build_info.json + COMMIT_SHA=${{ github.sha }} + SHORT_SHA=${COMMIT_SHA:0:7} + VERSION="${SHORT_SHA}-dev" + echo "version=${VERSION}" >> $GITHUB_OUTPUT + echo "short_sha=${SHORT_SHA}" >> $GITHUB_OUTPUT + echo "Generated version: ${VERSION}" + + - name: Inject commit hash into code (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: | + $json = @" + { + "version": "$env:VERSION" + } + "@ + $json | Out-File -Encoding utf8 build_info.json - name: Build executable with PyInstaller run: pyinstaller --onefile --windowed --add-data "build_info.json:." --name ${{ env.APP_NAME }} main.py @@ -114,16 +129,6 @@ jobs: find artifacts -type f ls -la artifacts/ - - name: Generate version - id: version - run: | - COMMIT_SHA=${{ github.sha }} - SHORT_SHA=${COMMIT_SHA:0:7} - VERSION="${SHORT_SHA}-dev" - echo "version=${VERSION}" >> $GITHUB_OUTPUT - echo "short_sha=${SHORT_SHA}" >> $GITHUB_OUTPUT - echo "Generated version: ${VERSION}" - - name: Prepare release files run: | mkdir -p release