-
-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create workflows for generating windows and linux binaries
Merge pull request #35 from amir16yp/main
- Loading branch information
Showing
3 changed files
with
124 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
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 |
This file contains 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
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 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# -*- mode: python ; coding: utf-8 -*- | ||
import os | ||
import site | ||
|
||
# Locate the site-packages directory | ||
site_packages_path = next(p for p in site.getsitepackages() if 'site-packages' in p) | ||
|
||
# Path to the legacy_blocks.json file | ||
legacy_blocks_path = os.path.join(site_packages_path, 'anvil', 'legacy_blocks.json') | ||
|
||
block_cipher = None | ||
|
||
a = Analysis(['arnis.py'], | ||
pathex=['.'], | ||
binaries=[], | ||
datas=[(legacy_blocks_path, 'anvil')], | ||
hiddenimports=[], | ||
hookspath=[], | ||
runtime_hooks=[], | ||
excludes=[], | ||
cipher=block_cipher, | ||
noarchive=False) | ||
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) | ||
exe = EXE(pyz, | ||
a.scripts, | ||
a.binaries, | ||
a.zipfiles, | ||
a.datas, | ||
name='arnis', | ||
debug=False, | ||
strip=False, | ||
upx=True, | ||
runtime_tmpdir=None, | ||
console=True ) |