-
Notifications
You must be signed in to change notification settings - Fork 45
149 lines (131 loc) · 3.88 KB
/
release.yml
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
148
149
name: Release
on:
pull_request:
branches:
- "master"
- "ci"
- "[0-9]+.[0-9x]+*"
paths:
- "edgedb/_version.py"
push:
branches:
- "ci"
jobs:
validate-release-request:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.checkver.outputs.version }}
steps:
- name: Store release version for later use
env:
VERSION: 1.9.0
run: |
mkdir -p dist/
echo "${VERSION}" > dist/VERSION
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist/
build-wheels-matrix:
needs: validate-release-request
runs-on: ubuntu-latest
outputs:
include: ${{ steps.set-matrix.outputs.include }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.x"
- run: pip install cibuildwheel==2.19.1
- id: set-matrix
# Cannot test on Musl distros yet.
run: |
MATRIX_INCLUDE=$(
{
cibuildwheel --print-build-identifiers --platform linux --arch x86_64,aarch64 | grep cp | grep many | grep 312 | jq -nRc '{"only": inputs, "os": "ubuntu-latest"}' \
&& cibuildwheel --print-build-identifiers --platform macos --arch x86_64,arm64 | grep cp | grep 312 | jq -nRc '{"only": inputs, "os": "macos-latest"}' \
&& cibuildwheel --print-build-identifiers --platform windows --arch AMD64 | grep cp | grep 312 | jq -nRc '{"only": inputs, "os": "windows-2019"}'
} | jq -sc
)
echo "include=$MATRIX_INCLUDE" >> $GITHUB_OUTPUT
build-wheels:
needs: build-wheels-matrix
runs-on: ${{ matrix.os }}
name: Build ${{ matrix.only }}
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.build-wheels-matrix.outputs.include) }}
defaults:
run:
shell: bash
env:
PIP_DISABLE_PIP_VERSION_CHECK: 1
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 50
submodules: true
- name: Setup WSL
if: ${{ matrix.os == 'windows-2019' }}
uses: vampire/setup-wsl@v2
with:
wsl-shell-user: edgedb
additional-packages:
ca-certificates
curl
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
- name: Install EdgeDB
uses: edgedb/setup-edgedb@v1
- uses: pypa/[email protected]
with:
only: ${{ matrix.only }}
env:
CIBW_BUILD_VERBOSITY: 1
CIBW_BEFORE_ALL_LINUX: >
.github/workflows/install-edgedb.sh
CIBW_TEST_EXTRAS: "test"
CIBW_TEST_COMMAND: >
python {project}/tests/__init__.py
CIBW_TEST_COMMAND_WINDOWS: >
python {project}\tests\__init__.py
CIBW_TEST_COMMAND_LINUX: >
PY=`which python`
&& CODEGEN=`which edgedb-py`
&& chmod -R go+rX "$(dirname $(dirname $(dirname $PY)))"
&& su -l edgedb -c "EDGEDB_PYTHON_TEST_CODEGEN_CMD=$CODEGEN $PY {project}/tests/__init__.py"
- uses: actions/upload-artifact@v3
with:
name: dist
path: wheelhouse/*.whl
publish:
needs: [build-wheels]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 5
submodules: false
- uses: actions/download-artifact@v3
with:
name: dist
path: dist/
- name: Extract Release Version
id: relver
run: |
set -e
echo ::set-output name=version::$(cat dist/VERSION)
rm dist/VERSION
- run: |
ls -al dist/
- name: Upload to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
# password: ${{ secrets.TEST_PYPI_TOKEN }}
# repository_url: https://test.pypi.org/legacy/