mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
100 lines
3.2 KiB
YAML
100 lines
3.2 KiB
YAML
# .github/workflows/wheel.yml
|
|
name: Build Wheels Universal
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
|
|
target_os:
|
|
description: 'Select OS to run on'
|
|
required: false
|
|
default: '["ubuntu-latest","macos-latest","windows-latest","macos-15-intel","ubuntu-24.04-arm"]'
|
|
type: choice
|
|
options:
|
|
- '["macos-latest"]'
|
|
- '["macos-15-intel"]'
|
|
- '["ubuntu-latest"]'
|
|
- '["windows-latest"]'
|
|
- '["ubuntu-24.04-arm"]'
|
|
- '["ubuntu-latest","windows-latest"]'
|
|
- '["ubuntu-latest","macos-latest"]'
|
|
- '["macos-latest","windows-latest"]'
|
|
- '["ubuntu-latest","macos-latest","windows-latest"]'
|
|
- '["ubuntu-latest","macos-latest","windows-latest","macos-15-intel","ubuntu-24.04-arm"]'
|
|
publish:
|
|
description: 'Publish to repository'
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
repository:
|
|
description: 'Select repository to publish (Attention: Disable pypi selection until release)'
|
|
required: false
|
|
default: 'testpypi'
|
|
type: choice
|
|
options:
|
|
- testpypi
|
|
- pypi
|
|
xpack_branch:
|
|
description: 'SQLBot X-Pack Branch'
|
|
required: true
|
|
type: choice
|
|
default: "main"
|
|
options:
|
|
- main
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ${{ matrix.os }}
|
|
environment: sqlbot-xpack-env
|
|
defaults:
|
|
run:
|
|
working-directory: ./sqlbot-xpack
|
|
strategy:
|
|
matrix:
|
|
os: ${{ fromJSON(inputs.target_os) }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Check out SQLBot xpack repo
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: dataease/sqlbot-xpack
|
|
ref: ${{ inputs.xpack_branch }}
|
|
path: ./sqlbot-xpack
|
|
token: ${{ secrets.GH_TOKEN }}
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
- name: Install and build
|
|
working-directory: ./sqlbot-xpack/xpack_static
|
|
run: |
|
|
npm install
|
|
npm run build:prod
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.11'
|
|
- name: Install build tools
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install cython wheel twine
|
|
- name: Install the latest version of uv
|
|
uses: astral-sh/setup-uv@v6
|
|
with:
|
|
version: "latest"
|
|
- name: Install dependencies
|
|
run: uv sync
|
|
- name: Build encrypted
|
|
run: python build_scripts/build.py
|
|
- name: Pre build wheel
|
|
run: python ./build_scripts/format.py encrypted
|
|
- name: Build wheel
|
|
run: python -m pip wheel --no-deps -w dist .
|
|
- name: Finish build wheek
|
|
run: python ./build_scripts/format.py
|
|
- name: Show wheel
|
|
run: unzip -l dist/*
|
|
- name: Publish to repository
|
|
if: ${{ inputs.publish }}
|
|
run: twine upload --repository-url ${{ inputs.repository == 'pypi' && 'https://upload.pypi.org/legacy/' || 'https://test.pypi.org/legacy/' }} -u __token__ -p ${{ inputs.repository == 'pypi' && secrets.FORMAL_PYPI_API_TOKEN || secrets.PYPI_API_TOKEN }} dist/*.whl --verbose
|