-
Notifications
You must be signed in to change notification settings - Fork 632
99 lines (96 loc) · 3.25 KB
/
xpack.yml
File metadata and controls
99 lines (96 loc) · 3.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# .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