Skip to content

Commit

Permalink
Add pyinstaller building workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
amir16yp authored Aug 14, 2024
1 parent e6b2082 commit 96060cb
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build and Release for Linux

on:
release:
types: [created] # Triggers only when a release is created

jobs:
build-and-release:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Create Executable
uses: Martin005/[email protected]
with:
python_ver: '3.10'
spec: 'pyinst-compile.spec'
requirements: 'requirements.txt'
upload_exe_with_name: 'arnis'
options: '--onefile --name arnis'

- name: Build
run: make build

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./dist/arnis
asset_name: arnis
asset_content_type: application/octet-stream
45 changes: 45 additions & 0 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build and Release for Windows

on:
release:
types: [created] # Triggers only when a release is created

jobs:
build-and-release:
runs-on: windows-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Create Executable
uses: Martin005/[email protected]
with:
python_ver: '3.10'
spec: 'pyinst-compile.spec'
requirements: 'requirements.txt'
upload_exe_with_name: 'arnis.exe'
options: '--onefile --name arnis'

- name: Build
run: make build

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./dist/arnis.exe
asset_name: arnis.exe
asset_content_type: application/octet-stream

0 comments on commit 96060cb

Please sign in to comment.