.github/workflows/pyinstaller.yml #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
os: [windows-latest, macos-latest, ubuntu-latest] | ||
env: | ||
isRelease: ${{ contains(fromJSON('["release"]'), github.event_name) }} | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
- name: install dependencies and Pyinstaller | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
pip install pyinstaller | ||
- name: build the executable file | ||
run: | | ||
pyinstaller --noconsole --onefile ./pyJSON.py | ||
- name: create artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: pyJSON-${{ matrix.os }} | ||
path: ./dist/* | ||
- name: pack data for release | ||
if: ${{ isRelease }} | ||
Check failure on line 39 in .github/workflows/pyinstaller.yml
|
||
run: | | ||
tag=$(git describe --tags --abbrev=0) | ||
release_name="pyJSON-$tag-${{ matrix.os }}" | ||
7z a -tzip "${release_name}.zip" "./dist/*" | ||
- name: add to release | ||
if: ${{ isRelease }} | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: pyJSON-*.zip | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |