Spaces:
Runtime error
Runtime error
File size: 4,195 Bytes
6e6388e c145eab 36e359a c145eab 6e6388e 36e359a 6e6388e c145eab 6e6388e c145eab |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Pyinstaller Packaging
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
permissions:
contents: write
jobs:
setup:
runs-on: ubuntu-latest
outputs:
PACKAGE_PREFIX: ${{ steps.get-package_prefix.outputs.PACKAGE_PREFIX }}
TAG_NAME: ${{ steps.get-package_prefix.outputs.TAG_NAME }}
HEAD_SHA_SHORT: ${{ steps.get-package_prefix.outputs.HEAD_SHA_SHORT }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- name: get-package_prefix
id: get-package_prefix
run: |
LIB_NAME=Formulator
TAG_NAME=pre
HEAD_SHA_SHORT=$(git rev-parse --short HEAD)
echo "::set-output name=PACKAGE_PREFIX::${LIB_NAME}_${TAG_NAME}"
echo "::set-output name=TAG_NAME::${TAG_NAME}"
echo "::set-output name=HEAD_SHA_SHORT::${HEAD_SHA_SHORT}"
release:
needs: [setup]
runs-on: ubuntu-latest
outputs:
Up_Url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: create_release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v0.0
release_name: Pre Release
draft: true
prerelease: true
windows:
needs: [setup, release]
runs-on: windows-latest
env:
PACKAGENAME: ${{ needs.setup.outputs.PACKAGE_PREFIX }}_windows_x64
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
pip install pyside6
- name: Build
run: |
pyinstaller -F -w -i assets/icon.ico qt/app.py
mv dist Formulator
mv assets Formulator/assets
mkdir ${{ env.PACKAGENAME }}
mv Formulator ${{ env.PACKAGENAME }}
7z a -t7z -r "$($Env:PACKAGENAME + '.7z')" "Formulator"
- name: Upload
uses: actions/upload-artifact@v4
with:
name: ${{ env.PACKAGENAME }}
path: ${{ env.PACKAGENAME }}
- name: upload-win
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.Up_Url }}
asset_path: ${{ env.PACKAGENAME }}.7z
asset_name: ${{ env.PACKAGENAME }}.7z
asset_content_type: application/zip
macos:
needs: [ setup, release ]
runs-on: macos-11
env:
PACKAGENAME: ${{ needs.setup.outputs.PACKAGE_PREFIX }}_macos_x64
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
pip install pyside6
brew install create-dmg
- name: Build
run: |
cp assets/icon.icns ./
pyinstaller --clean --onedir --name Formulator --strip --windowed -i icon.icns qt/app.py
rm -rf dist/Formulator
ln -s /Applications/ dist/Applications
xattr -cr dist/Formulator.app
create-dmg --volname "Formulator" ${{ env.PACKAGENAME }}.dmg dist/
zip -9 Formulator.zip ${{ env.PACKAGENAME }}.dmg
- name: Upload
uses: actions/upload-artifact@v2
with:
name: ${{ env.PACKAGENAME }}
path: Formulator.zip
- name: upload-macos
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.Up_Url }}
asset_path: ${{ env.PACKAGENAME }}.dmg
asset_name: ${{ env.PACKAGENAME }}.dmg
asset_content_type: application/gzip |