NUSGet/.github/workflows/python-build.yml

126 lines
3.2 KiB
YAML

# This workflow will install Python dependencies and then build NUSGet for all platforms
name: Python application
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install ccache for Nuitka
run: sudo apt update && sudo apt install -y ccache libicu70
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Build Package
run: make all
- name: Prepare Package for Upload
run: |
mv NUSGet ~/NUSGet
cd ~
tar cvf NUSGet.tar NUSGet
- name: Upload Package
uses: actions/upload-artifact@v4
with:
path: ~/NUSGet.tar
name: NUSGet-Linux-bin
build-macos-x86:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Build Package
run: ARCH_FLAGS=--macos-target-arch=x86_64 make all
- name: Prepare Package for Upload
run: |
mv NUSGet.app ~/NUSGet.app
cd ~
tar cvf NUSGet.tar NUSGet.app
- name: Upload Package
uses: actions/upload-artifact@v4
with:
path: ~/NUSGet.tar
name: NUSGet-macOS-x86_64-bin
build-macos-arm64:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Build Package
run: ARCH_FLAGS=--macos-target-arch=arm64 make all
- name: Prepare Package for Upload
run: |
mv NUSGet.app ~/NUSGet.app
cd ~
tar cvf NUSGet.tar NUSGet.app
- name: Upload Package
uses: actions/upload-artifact@v4
with:
path: ~/NUSGet.tar
name: NUSGet-macOS-arm64-bin
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1.13.0
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Build Package
run: .\Build.ps1
- name: Upload Package
uses: actions/upload-artifact@v4
with:
path: D:\a\NUSGet\NUSGet\NUSGet.dist
name: NUSGet-Windows-bin
- name: Upload Onefile Package
uses: actions/upload-artifact@v4
with:
path: D:\a\NUSGet\NUSGet\NUSGet.exe
name: NUSGet-Windows-onefile-bin