Skip to content

Renaming in pyinstaller bootloader to avoid antivirus issues with Win… #237

Renaming in pyinstaller bootloader to avoid antivirus issues with Win…

Renaming in pyinstaller bootloader to avoid antivirus issues with Win… #237

Workflow file for this run

name: build-release
env:
ai_s3_endpoint: ${{ secrets.AI_S3_ENDPOINT }}
ai_s3_access_key: ${{ secrets.AI_S3_ACCESS_KEY }}
ai_s3_secret_key: ${{ secrets.AI_S3_SECRET_KEY }}
ai_s3_bucket_name: ${{ secrets.AI_S3_BUCKET_NAME }}
on:
push:
tags:
- v*.*.*
jobs:
build-linux:
runs-on: ubuntu-20.04
steps:
- name: setup python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: checkout repository
uses: actions/checkout@v3
- name: configure ai s3 secrets
run: |
echo "endpoint = \"$ai_s3_endpoint\"" >> ./graxpert/s3_secrets.py && \
echo "ro_access_key = \"$ai_s3_access_key\"" >> ./graxpert/s3_secrets.py && \
echo "ro_secret_key = \"$ai_s3_secret_key\"" >> ./graxpert/s3_secrets.py && \
echo "bucket_name = \"$ai_s3_bucket_name\"" >> ./graxpert/s3_secrets.py
- name: install dependencies
run: |
pip install setuptools wheel pyinstaller && \
pip install -r requirements.txt
- name: patch version
run: |
chmod u+x ./releng/patch_version.sh && \
./releng/patch_version.sh
- name: create GraXpert-linux bundle
run: |
pyinstaller \
./GraXpert-linux.spec \
- name: store artifacts
uses: actions/upload-artifact@v2
with:
name: GraXpert-linux
path: ./dist/GraXpert-linux
retention-days: 5
build-windows:
runs-on: windows-latest
steps:
- name: setup python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: checkout repository
uses: actions/checkout@v3
- name: checkout pyinstaller
uses: actions/checkout@v3
with:
repository: pyinstaller/pyinstaller
path: ./pyinstaller
ref: v6.1.0
- name: configure ai s3 secrets
run: |
$PSDefaultParameterValues['Out-File:Encoding']='UTF8' ; `
"endpoint = `"$env:ai_s3_endpoint`"" | Out-File -Append .\graxpert\s3_secrets.py ; `
"ro_access_key = `"$env:ai_s3_access_key`"" | Out-File -Append .\graxpert\s3_secrets.py ; `
"ro_secret_key = `"$env:ai_s3_secret_key`"" | Out-File -Append .\graxpert\s3_secrets.py ; `
"bucket_name = `"$env:ai_s3_bucket_name`"" | Out-File -Append .\graxpert\s3_secrets.py
- name: install dependencies
run: |
pip install setuptools wheel && `
cd .\pyinstaller\bootloader && `
(Get-Content .\wscript) -Replace "'run'", "'graxpert'" | Set-Content .\wscript && `
(Get-Content .\src\main.c) -Replace 'pyi_main\(', 'my_pyi_main(' | Set-Content .\src\main.c && `
(Get-Content .\src\pyi_main.h) -Replace 'pyi_main\(', 'my_pyi_main(' | Set-Content .\src\pyi_main.h && `
(Get-Content .\src\pyi_main.c) -Replace 'pyi_main\(', 'my_pyi_main(' | Set-Content .\src\pyi_main.c && `
python ./waf all && `
cd .. && `
(Get-Content .\setup.py) -Replace 'run.exe', 'graxpert.exe' | Set-Content .\setup.py && `
cd .. && `
pip install pyinstaller --no-index --find-links D:\a\GraXpert\GraXpert\pyinstaller\PyInstaller && `
pip install -r requirements.txt
- name: patch version
run: ./releng/patch_version.ps1
- name: create GraXpert-win64 bundle
run: |
pyinstaller `
./GraXpert-win64.spec `
- name: store artifacts
uses: actions/upload-artifact@v2
with:
name: GraXpert-win64.exe
path: ./dist/GraXpert-win64.exe
retention-days: 5
build-macos-x86_64:
runs-on: macos-11
steps:
- name: checkout repository
uses: actions/checkout@v3
- name: configure ai s3 secrets
run: |
echo "endpoint = \"$ai_s3_endpoint\"" >> ./graxpert/s3_secrets.py && \
echo "ro_access_key = \"$ai_s3_access_key\"" >> ./graxpert/s3_secrets.py && \
echo "ro_secret_key = \"$ai_s3_secret_key\"" >> ./graxpert/s3_secrets.py && \
echo "bucket_name = \"$ai_s3_bucket_name\"" >> ./graxpert/s3_secrets.py
# github actions overwrites brew's python. Force it to reassert itself, by running in a separate step.
- name: unbreak python in github actions
run: |
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
sudo rm -rf /Library/Frameworks/Python.framework/
brew install --force python3 && brew unlink python3 && brew unlink python3 && brew link --overwrite python3
- name: install dependencies
run: |
brew install python-tk && \
pip3 install setuptools wheel pyinstaller && \
pip3 install -r requirements.txt
- name: patch version
run: |
chmod u+x ./releng/patch_version.sh && \
./releng/patch_version.sh
- name: create GraXpert-macos-x86_64 bundle
run: |
pyinstaller \
./GraXpert-macos-x86_64.spec
- name: install create-dmg
run: brew install create-dmg
- name: create .dmg
run: |
create-dmg \
--volname "GraXpert-macos-x86_64" \
--window-pos 50 50 \
--window-size 1920 1080 \
--icon-size 100 \
--icon "GraXpert.app" 200 190 \
--app-drop-link 400 190 \
"dist/GraXpert-macos-x86_64.dmg" \
"dist/GraXpert.app/"
- name: store artifacts
uses: actions/upload-artifact@v2
with:
name: GraXpert-macos-x86_64.dmg
path: ./dist/GraXpert-macos-x86_64.dmg
retention-days: 5
release:
runs-on: ubuntu-latest
needs: [build-linux, build-windows, build-macos-x86_64]
steps:
- name: download linux binary
uses: actions/download-artifact@v2
with:
name: GraXpert-linux
- name: download windows exe
uses: actions/download-artifact@v2
with:
name: GraXpert-win64.exe
- name: download macos artifacts
uses: actions/download-artifact@v2
with:
name: GraXpert-macos-x86_64.dmg
- name: create release
uses: softprops/action-gh-release@v1
with:
files: |
GraXpert-linux
GraXpert-win64.exe
GraXpert-macos-x86_64.dmg