-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
61 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,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 | ||
|