-
Notifications
You must be signed in to change notification settings - Fork 5
147 lines (135 loc) · 4.48 KB
/
Copy pathbuild-release.yaml
File metadata and controls
147 lines (135 loc) · 4.48 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: build flux-python
on:
pull_request: {}
workflow_dispatch:
inputs:
version:
description: 'Pypi version'
release_version:
description: 'Version of flux to build'
default: "0.88.0"
rc:
description: 'Release candidate to build (for wheel)'
default: "0"
branch:
description: 'Branch or tag to build from (defaults to v<release_version>)'
default: ""
repo:
description: 'Repository to build from'
default: "https://github.com/flux-framework/flux-core"
glibc:
description: 'Oldest glibc to support, as a manylinux tag version'
default: "2_17"
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# Maybe time to stop supporting...
- python: "3.8"
base: jammy
- python: "3.9"
base: jammy
- python: "3.10"
base: jammy
- python: "3.11"
base: jammy
- python: "3.12"
base: jammy
- python: "3.13"
base: jammy
# Update to noble for 3.14
- python: "3.14"
base: noble
container:
image: fluxrm/testenv:${{ matrix.base }}
steps:
- uses: actions/checkout@v7
- name: Setup Python
env:
python_version: ${{ matrix.python }}
# Installs to /opt/conda/envs/build/bin/python3
run: /bin/bash ./docker/install-mamba.sh ${python_version}
- name: Build Flux Core Branch
env:
FLUX_RELEASE_VERSION: ${{ inputs.release_version || '0.88.0' }}
FLUX_VERSION: ${{ inputs.version || inputs.release_version || '0.88.0' }}
run: /bin/bash .github/scripts/setup.sh
- name: Build Python Bindings
env:
FLUX_BRANCH: ${{ inputs.branch }}
FLUX_REPO: ${{ inputs.repo }}
FLUX_RELEASE_VERSION: ${{ inputs.release_version || '0.88.0' }}
shell: bash
run: |
if [[ "${FLUX_REPO}" == "" ]]; then
FLUX_REPO="https://github.com/flux-framework/flux-core"
fi
# Match the bindings to the release that libflux was built from
if [[ "${FLUX_BRANCH}" == "" ]]; then
FLUX_BRANCH="v${FLUX_RELEASE_VERSION}"
fi
echo "Flux Repo: ${FLUX_REPO}"
echo "Flux Branch: ${FLUX_BRANCH}"
git clone -b ${FLUX_BRANCH} ${FLUX_REPO} /tmp/flux-core
mv /tmp/flux-core/src/bindings/python/flux ./flux
/opt/conda/envs/build/bin/python3 setup.py sdist
sudo ldconfig
- name: Build Python Wheels
env:
build_number: ${{ inputs.rc || '0' }}
python_version: ${{ matrix.python }}
MANYLINUX_GLIBC: ${{ inputs.glibc || '2_17' }}
run: |
/bin/bash ./docker/build-wheels.sh "${build_number}" "${python_version}"
ls ./dist
- name: Test Install
shell: bash
run: |
# Use a clean environment so the build env cannot mask missing dependencies
/opt/conda/envs/build/bin/python3 -m venv /tmp/test-env
/tmp/test-env/bin/python3 -m pip install ./dist/*.whl
cd /tmp
/tmp/test-env/bin/python3 -c "import flux, flux.job, _flux._core, _flux._hostlist, _flux._idset; print(flux.__file__)"
- name: Upload Artifacts
if: success()
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.python }}
path: ./dist
upload:
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Download Artifacts
uses: actions/download-artifact@v8
# If name unspecified, all artifacts download for run
- name: Show Files
run: |
ls */
# We just need one of these
first_dir=$(ls . | head -n 1)
mkdir -p ./dist
mv */*.whl ./dist/
cp ${first_dir}/*.tar.gz ./dist/
echo
echo "Files to distribute:"
ls ./dist
- name: Check distributions
run: |
python3 -m pip install setuptools wheel twine
twine check --strict dist/*
- name: Test upload
if: (github.event_name != 'workflow_dispatch')
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }}
run: twine upload --verbose --repository testpypi --skip-existing dist/flux_python*
- name: Build and publish
if: (github.event_name == 'workflow_dispatch')
env:
TWINE_USERNAME: ${{ secrets.PYPI_USER }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASS }}
run: twine upload --verbose --skip-existing dist/flux_python*