-
Notifications
You must be signed in to change notification settings - Fork 305
130 lines (115 loc) · 3.82 KB
/
esiRuntimePublish.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
name: Publish ESI Runtime
on:
push:
tags:
- ESIRuntime-*
schedule:
- cron: 0 12 * * 1
workflow_dispatch:
jobs:
build_wheels:
name: Build wheels with ${{ matrix.config.cibw_build }}
runs-on: ${{ matrix.config.os }}
if: github.repository == 'llvm/circt'
strategy:
fail-fast: false
matrix:
config:
- os: ubuntu-20.04
cibw_build: cp38-manylinux_x86_64
- os: ubuntu-20.04
cibw_build: cp39-manylinux_x86_64
- os: ubuntu-20.04
cibw_build: cp310-manylinux_x86_64
- os: ubuntu-20.04
cibw_build: cp311-manylinux_x86_64
- os: ubuntu-20.04
cibw_build: cp312-manylinux_x86_64
- os: windows-2022
cibw_build: cp38-win_amd64
- os: windows-2022
cibw_build: cp39-win_amd64
- os: windows-2022
cibw_build: cp310-win_amd64
- os: windows-2022
cibw_build: cp311-win_amd64
- os: windows-2022
cibw_build: cp312-win_amd64
steps:
- name: Get CIRCT
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: false
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install deps with choco (Windows)
shell: pwsh
if: runner.os == 'Windows'
run: choco install ninja
- name: Build additional c++ deps (Windows)
shell: pwsh
if: runner.os == 'Windows'
# TODO: cache the binaries produced by vcpkg to save ~1hr of build time:
# https://learn.microsoft.com/en-us/vcpkg/consume/binary-caching-github-packages?pivots=windows-runner
run: |
& "${env:VCPKG_INSTALLATION_ROOT}/vcpkg" --triplet x64-windows install zlib
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.16.2
- name: Build wheels
if: runner.os != 'Windows'
env:
CIBW_BUILD: ${{ matrix.config.cibw_build }}
CIBW_MANYLINUX_X86_64_IMAGE: ghcr.io/circt/images/esiruntime-wheel
SETUPTOOLS_SCM_DEBUG: True
run: python -m cibuildwheel --output-dir wheelhouse ./lib/Dialect/ESI/runtime
- name: Build wheels (Windows)
if: runner.os == 'Windows'
shell: pwsh
env:
CIBW_BUILD: ${{ matrix.config.cibw_build }}
SETUPTOOLS_SCM_DEBUG: True
CIRCT_EXTRA_CMAKE_ARGS: -DESI_COSIM=OFF
run: |
echo "Building wheel"
& "${env:GITHUB_WORKSPACE}\utils\find-vs.ps1"
python3 -m cibuildwheel --output-dir wheelhouse ./lib/Dialect/ESI/runtime
- name: Get wheel name
shell: bash
id: whl-name
run: |
cd wheelhouse
echo WHL=`ls *.whl` >> "$GITHUB_OUTPUT"
- name: Upload wheels as artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ steps.whl-name.outputs.WHL }}
path: wheelhouse/${{ steps.whl-name.outputs.WHL }}
retention-days: 7
if-no-files-found: error
push_wheels:
name: Push wheels (Tag or Weekly)
runs-on: ubuntu-20.04
needs: build_wheels
environment:
name: pypi
url: https://pypi.org/p/esiaccel
permissions:
id-token: write
steps:
- name: Download wheels
uses: actions/download-artifact@v4
with:
path: ./wheelhouse/
merge-multiple: true
- name: List downloaded wheels
run: ls -laR
working-directory: ./wheelhouse/
- name: Upload wheels to pypi
uses: pypa/gh-action-pypi-publish@release/v1
if: github.repository == 'llvm/circt' && (github.ref_type == 'tag' || github.event_name == 'schedule')
with:
packages-dir: wheelhouse/
verify-metadata: false