Skip to content

Version 1.2.1

Version 1.2.1 #42

# Checks BiaPy code consistency
name: Create Linux binary
on:
workflow_dispatch:
release:
types: [published]
jobs:
run:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip" # caching pip dependencies
- name: Install Qt/X11 runtime deps
run: |
sudo apt-get update
sudo apt-get install -y libxcb-shape0 libxcb-keysyms1 libxcb-render-util0 \
libxcb-icccm4 libxkbcommon-x11-0 libxcb-image0 \
libxcb-xkb1 libxcb-cursor0
- name: Installing BiaPy-GUI dependencies
run: pip install -r requirements.txt
- name: Creating Linux binary
run: |
cp dist-linux/main.spec main.spec
pyinstaller main.spec
- name: Check dist folder contents
run: |
echo "== dist tree =="
ls -R dist || true
- name: Upload dist/BiaPy to Google Drive (Python method)
env:
FOLDER_ID: ${{ secrets.FOLDER_FOR_NEW_BINARIES }}
run: |
# Install Google API client
python -m pip install --quiet google-api-python-client google-auth google-auth-httplib2 google-auth-oauthlib
# Decode your base64 credentials into a JSON file
echo "${{ secrets.DRIVE_CREDENTIALS }}" | base64 -d > sa.json
# Run the upload script
python - <<'PY'
import os, mimetypes
from google.oauth2.service_account import Credentials
from googleapiclient.discovery import build
from googleapiclient.http import MediaFileUpload
FOLDER_ID = os.environ["FOLDER_ID"]
PATH = "dist/BiaPy"
# Authorize with service account
creds = Credentials.from_service_account_file(
"sa.json",
scopes=["https://www.googleapis.com/auth/drive"]
)
service = build("drive", "v3", credentials=creds, cache_discovery=False)
# Upload file (or folder as zip)
name = os.path.basename(PATH.rstrip("/"))
mime_type = mimetypes.guess_type(PATH)[0] or "application/octet-stream"
media = MediaFileUpload(PATH, mimetype=mime_type, resumable=True)
file_metadata = {"name": name, "parents": [FOLDER_ID]}
print(f"Uploading {PATH} to folder {FOLDER_ID} ...")
file = service.files().create(body=file_metadata, media_body=media, fields="id,name").execute()
print(f"✅ Uploaded {file['name']} with id {file['id']}")
PY