forked from flagos-ai/FlagGems
-
Notifications
You must be signed in to change notification settings - Fork 3
89 lines (74 loc) · 2.44 KB
/
release.yaml
File metadata and controls
89 lines (74 loc) · 2.44 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
name: release-build-wheels
on:
push:
tags:
- 'v*'
permissions:
contents: read
jobs:
build-wheels:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Pull manylinux2_28 image
run: docker pull quay.io/pypa/manylinux_2_28_x86_64
- name: Prepare directories
run: |
rm -rf ${{ runner.temp }}/wheelhouse ${{ runner.temp }}/build_temp
mkdir -p ${{ runner.temp }}/wheelhouse
mkdir -p ${{ runner.temp }}/build_temp
- name: Start manylinux builder container
run: |
container=$(docker run -td \
--name "flaggems_builder" \
-v ${{ github.workspace }}:/workspace \
-v ${{ runner.temp }}/build_temp:/workspace/build \
-v ${{ runner.temp }}/wheelhouse:/wheelhouse \
-w /workspace \
quay.io/pypa/manylinux_2_28_x86_64)
echo "CONTAINER=$container" >> $GITHUB_ENV
- name: Install build tools inside container
run: |
docker exec -t $CONTAINER bash -c "
set -e
/opt/python/cp38-cp38/bin/python -m pip install --upgrade pip setuptools wheel build
"
- name: Patch pyproject.toml to use setuptools backend
run: |
docker exec -t $CONTAINER bash -c "
set -e
sed -i 's/build-backend = \"scikit_build_core.build\"/build-backend = \"setuptools.build_meta\"/' pyproject.toml
"
- name: Build wheel for Python 3.8
run: |
docker exec -t $CONTAINER bash -c "
set -e
/opt/python/cp38-cp38/bin/python -m build --wheel --outdir /wheelhouse
"
- name: Upload wheel as artifact
uses: actions/upload-artifact@v7
with:
name: built-wheel-${{ github.ref_name }}
path: ${{ runner.temp }}/wheelhouse/*.whl
- name: Cleanup container
if: always()
run: docker rm -f $CONTAINER
publish:
needs: build-wheels
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Download built wheel
uses: actions/download-artifact@v8
with:
name: built-wheel-${{ github.ref_name }}
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__