Skip to content

Commit c6faede

Browse files
fix(ci): build manylinux for publish
1 parent 0691acb commit c6faede

3 files changed

Lines changed: 103 additions & 18 deletions

File tree

.github/workflows/deploy-docs.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,16 @@ jobs:
3131
with:
3232
path: pywire
3333
fetch-depth: 0
34+
submodules: recursive
3435

35-
- name: Checkout tree-sitter-pywire
36-
uses: actions/checkout@v4
37-
with:
38-
repository: ${{ github.repository_owner }}/tree-sitter-pywire
39-
path: tree-sitter-pywire
40-
fetch-depth: 0
36+
- name: Update tree-sitter-pywire submodule (Latest Tag)
37+
working-directory: pywire/tree-sitter-pywire
38+
run: |
39+
git fetch --tags
40+
# Get latest tag (v*) sorted by version
41+
LATEST_TAG=$(git tag -l "v*" --sort=-v:refname | head -n 1)
42+
echo "Checking out $LATEST_TAG"
43+
git checkout $LATEST_TAG
4144
4245
- name: Setup Node.js
4346
uses: actions/setup-node@v4

.github/workflows/publish.yml

Lines changed: 93 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,71 @@ on:
55
tags:
66
- "v*"
77

8+
permissions:
9+
id-token: write
10+
contents: write
11+
812
jobs:
9-
publish:
13+
build_wheels:
14+
name: Build wheels on ${{ matrix.os }}
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
matrix:
18+
os: [ubuntu-latest, macos-latest, windows-latest]
19+
20+
steps:
21+
- name: Checkout pywire
22+
uses: actions/checkout@v4
23+
with:
24+
path: pywire
25+
fetch-depth: 0
26+
submodules: recursive
27+
28+
- name: Update tree-sitter-pywire submodule (Latest Tag)
29+
working-directory: pywire/tree-sitter-pywire
30+
run: |
31+
git fetch --tags
32+
LATEST_TAG=$(git tag -l "v*" --sort=-v:refname | head -n 1)
33+
echo "Checking out $LATEST_TAG"
34+
git checkout $LATEST_TAG
35+
36+
- name: Install pnpm
37+
uses: pnpm/action-setup@v2
38+
with:
39+
version: 9
40+
41+
- name: Setup Node.js
42+
uses: actions/setup-node@v4
43+
with:
44+
node-version: '20'
45+
cache: 'pnpm'
46+
cache-dependency-path: 'pywire/src/pywire/client/pnpm-lock.yaml'
47+
48+
- name: Build client bundle
49+
working-directory: pywire
50+
run: |
51+
cd src/pywire/client
52+
pnpm install --frozen-lockfile
53+
pnpm build
54+
55+
- name: Build wheels
56+
uses: pypa/cibuildwheel@v2.22.0
57+
env:
58+
CIBW_SKIP: "cp37-* cp38-* cp39-* cp310-*"
59+
CIBW_ARCHS: "auto64"
60+
CIBW_BUILD_FRONTEND: "build"
61+
with:
62+
package-dir: pywire
63+
output-dir: wheelhouse
64+
65+
- uses: actions/upload-artifact@v4
66+
with:
67+
name: cibw-wheels-${{ matrix.os }}
68+
path: ./wheelhouse/*.whl
69+
70+
build_sdist:
71+
name: Build sdist
1072
runs-on: ubuntu-latest
11-
environment: release
12-
permissions:
13-
id-token: write
14-
contents: write
1573
steps:
1674
- name: Checkout pywire
1775
uses: actions/checkout@v4
@@ -24,7 +82,6 @@ jobs:
2482
working-directory: pywire/tree-sitter-pywire
2583
run: |
2684
git fetch --tags
27-
# Get latest tag (v*) sorted by version
2885
LATEST_TAG=$(git tag -l "v*" --sort=-v:refname | head -n 1)
2986
echo "Checking out $LATEST_TAG"
3087
git checkout $LATEST_TAG
@@ -41,16 +98,41 @@ jobs:
4198
cache: 'pnpm'
4299
cache-dependency-path: 'pywire/src/pywire/client/pnpm-lock.yaml'
43100

101+
- name: Build client bundle
102+
working-directory: pywire
103+
run: |
104+
cd src/pywire/client
105+
pnpm install --frozen-lockfile
106+
pnpm build
107+
44108
- name: Install uv
45109
uses: astral-sh/setup-uv@v5
46-
with:
47-
enable-cache: true
48110

49-
- name: Build
50-
run: uv build
111+
- name: Build sdist
112+
run: uv build --sdist
51113
working-directory: pywire
52114

115+
- uses: actions/upload-artifact@v4
116+
with:
117+
name: cibw-sdist
118+
path: pywire/dist/*.tar.gz
119+
120+
publish:
121+
name: Publish
122+
needs: [build_wheels, build_sdist]
123+
runs-on: ubuntu-latest
124+
environment: release
125+
permissions:
126+
id-token: write
127+
contents: write
128+
steps:
129+
- uses: actions/download-artifact@v4
130+
with:
131+
pattern: cibw-*
132+
path: dist
133+
merge-multiple: true
134+
53135
- name: Publish
54136
uses: pypa/gh-action-pypi-publish@release/v1
55137
with:
56-
packages-dir: pywire/dist/
138+
packages-dir: dist/

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "tree-sitter-pywire"]
22
path = tree-sitter-pywire
3-
url = https://github.com/pywire/tree-sitter-pywire.git
3+
url = ../tree-sitter-pywire.git

0 commit comments

Comments
 (0)