Skip to content

Commit

Permalink
Add build
Browse files Browse the repository at this point in the history
  • Loading branch information
0x24a committed Jul 22, 2024
1 parent 5e3c5f8 commit 7e65a93
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/build_and_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Build and Release

on:
release:
types: [created]

jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
asset_name: linux-x64
- os: windows-latest
asset_name: windows-x64.exe
- os: macos-latest
asset_name: macos

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

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install nuitka
pip install -r requirements.txt
- name: Build with Nuitka
run: |
python -m nuitka --standalone --nofollow-imports --output-dir=build main.py
- name: Rename executable
run: |
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
mv build/your_main_script.bin build/${{ matrix.asset_name }}
elif [ "${{ matrix.os }}" = "windows-latest" ]; then
mv build/your_main_script.exe build/${{ matrix.asset_name }}
elif [ "${{ matrix.os }}" = "macos-latest" ]; then
mv build/your_main_script.bin build/${{ matrix.asset_name }}
fi
shell: bash

- 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: ./build/${{ matrix.asset_name }}
asset_name: ${{ matrix.asset_name }}
asset_content_type: application/octet-stream

0 comments on commit 7e65a93

Please sign in to comment.