-
Notifications
You must be signed in to change notification settings - Fork 4
109 lines (100 loc) · 3.07 KB
/
build-release.yaml
File metadata and controls
109 lines (100 loc) · 3.07 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
name: build flux-python
on:
pull_request: {}
workflow_dispatch:
inputs:
version:
description: 'Pypi version'
release_version:
description: 'Version of flux to build'
default: "0.68.0"
rc:
description: 'Release candidate to build (for wheel)'
default: "0"
branch:
description: 'Branch to build from'
default: "master"
repo:
description: 'Repository to build from'
default: "https://github.com/flux-framework/flux-core"
jobs:
build-manual:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
container:
image: fluxrm/testenv:jammy
steps:
- uses: actions/checkout@v4
- 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 }}
FLUX_VERSION: ${{ inputs.version }}
run: /bin/bash .github/scripts/setup.sh
- name: Build Python Bindings
env:
FLUX_BRANCH: ${{ inputs.branch }}
FLUX_REPO: ${{ inputs.repo }}
shell: bash
run: |
echo "Flux Repo: ${FLUX_REPO}"
echo "Flux Branch: ${FLUX_BRANCH}"
if [[ "${FLUX_REPO}" == "" ]]; then
FLUX_REPO="https://github.com/flux-framework/flux-core"
fi
if [[ "${FLUX_BRANCH}" == "" ]]; then
FLUX_BRANCH="master"
fi
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 }}
python_version: ${{ matrix.python }}
run: |
/bin/bash ./docker/build-wheels.sh ${build_number} ${python_version}
ls ./dist
- name: Upload distributions
if: success()
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.python }}
path: ./dist
upload:
runs-on: ubuntu-latest
needs: [build-manual]
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
# 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: Build and publish
if: (github.event_name != 'pull_request')
env:
TWINE_USERNAME: ${{ secrets.PYPI_USER }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASS }}
run: |
ls dist/
python3 -m pip install setuptools wheel
python3 -m pip install twine==6.0.1
python3 -m pip install --upgrade pkginfo
twine upload --skip-existing dist/flux_python*