Skip to content

LinceMathew building the binary using nuitka πŸš€ #80

LinceMathew building the binary using nuitka πŸš€

LinceMathew building the binary using nuitka πŸš€ #80

name: Binary Build And Release
run-name: ${{ github.actor }} building the binary using nuitka πŸš€
on:
push:
tags:
- '*'
workflow_dispatch:
jobs:
Binary-Build-Linux:
name: Build For Linux
runs-on: ubuntu-latest
steps:
- run: echo "πŸŽ‰ The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "πŸ”Ž The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v2
- name: Build and run Docker image
run: |
docker build -t glee:latest .
docker run -d --name glee glee:latest
- name: Copy file from Docker container
run: |
docker cp glee:/app/glee.bin /tmp/glee_linux.bin
- name: Store artifact
uses: actions/upload-artifact@v2
with:
name: glee_linux.bin
path: /tmp/glee_linux.bin
Binary-Build-Mac:
name: Build For Mac OS
runs-on: macos-latest
if: false
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
export PATH="$HOME/.poetry/bin:$PATH"
- name: Install dependencies and build
run: |
/Users/runner/.local/bin/poetry config virtualenvs.create false
/Users/runner/.local/bin/poetry install --no-interaction --no-ansi
python3 -m nuitka --onefile --follow-imports --include-package=pygments --disable-ccache --output-filename=glee_mac.bin glee.py
- name: Store artifact
uses: actions/upload-artifact@v2
with:
name: glee_mac.bin
path: glee_mac.bin
Binary-Build-Windows:
name: Build For Windows
runs-on: windows-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: Install Poetry
run: |
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python -
$env:PATH = "$env:USERPROFILE\.poetry\bin;$env:PATH"
- name: Install dependencies and build
run: |
C:\Users\runneradmin\AppData\Roaming\Python\Scripts\poetry config virtualenvs.create false
C:\Users\runneradmin\AppData\Roaming\Python\Scripts\poetry install --no-interaction --no-ansi
python -m nuitka --onefile --follow-imports --include-package=pygments --disable-cache=all --assume-yes-for-downloads --output-filename=glee_windows.exe glee.py
- name: Store artifact
uses: actions/upload-artifact@v2
with:
name: glee_windows.exe
path: glee_windows.exe
Binary-Release:
name: Create Release
# needs: [Binary-Build-Linux, Binary-Build-Mac,Binary-Build-Windows]
needs: [Binary-Build-Linux,Binary-Build-Windows]
runs-on: ubuntu-latest
steps:
- name: Download Linux artifact
uses: actions/download-artifact@v2
with:
name: glee_linux.bin
path: /tmp
# - name: Download macOS artifact
# uses: actions/download-artifact@v2
# with:
# name: glee_mac.bin
# path: /tmp
- name: Download Windows artifact
uses: actions/download-artifact@v2
with:
name: glee_windows.exe
path: /tmp
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Linux Release Asset
id: upload-linux-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /tmp/glee_linux.bin
asset_name: glee_linux.bin
asset_content_type: application/octet-stream
# - name: Upload macOS Release Asset
# id: upload-macos-release-asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: /tmp/glee_mac.bin
# asset_name: glee_mac.bin
# asset_content_type: application/octet-stream
- name: Upload Windows Release Asset
id: upload-windows-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /tmp/glee_windows.exe
asset_name: glee_windows.exe
asset_content_type: application/octet-stream