@@ -3,8 +3,8 @@ name: Upload to PyPI
3
3
on :
4
4
push :
5
5
tags :
6
- - ' v[0-9]+.*'
7
- - ' test-v[0-9]+.*' # Uploads to https://test.pypi.org/project/tree-sitter/
6
+ - " v[0-9]+.*"
7
+ - " test-v[0-9]+.*" # Uploads to https://test.pypi.org/project/tree-sitter/
8
8
9
9
jobs :
10
10
build-sdist :
15
15
submodules : true
16
16
- uses : actions/setup-python@v4
17
17
with :
18
- python-version : ' 3.10'
18
+ python-version : " 3.10"
19
19
- run : python setup.py sdist
20
20
- uses : actions/upload-artifact@v3
21
21
with :
35
35
36
36
- uses : actions/setup-python@v4
37
37
with :
38
- python-version : ' 3.10'
38
+ python-version : " 3.10"
39
39
40
40
- if : ${{ startsWith(matrix.os, 'windows') }}
41
41
run : script\fetch-fixtures.cmd
47
47
- run : python -m cibuildwheel --output-dir dist
48
48
env :
49
49
CIBW_TEST_COMMAND : python -m unittest discover -s {package}/tests
50
- CIBW_ARCHS_MACOS : x86_64 arm64
50
+ CIBW_ARCHS_MACOS : x86_64 arm64 universal2
51
+ CIBW_ARCHS_LINUX : x86_64 aarch64
51
52
52
53
# Make wheels downloadable from GitHub UI and from the pypi step
53
54
- uses : actions/upload-artifact@v3
@@ -68,16 +69,29 @@ jobs:
68
69
69
70
# https://stackoverflow.com/a/58478262
70
71
- if : ${{ startsWith(github.ref, 'refs/tags/test-v') }}
71
- name : ' Upload to test.pypi.org'
72
+ name : " Upload to test.pypi.org"
72
73
uses : pypa/gh-action-pypi-publish@release/v1
73
74
with :
74
75
user : __token__
75
76
password : ${{ secrets.TEST_PYPI_API_TOKEN }}
76
77
repository_url : https://test.pypi.org/legacy/
77
78
78
79
- if : ${{ startsWith(github.ref, 'refs/tags/v') }}
79
- name : ' Upload to pypi.org'
80
+ name : " Upload to pypi.org"
80
81
uses : pypa/gh-action-pypi-publish@release/v1
81
82
with :
82
83
user : __token__
83
84
password : ${{ secrets.PYPI_API_TOKEN }}
85
+
86
+ - if : ${{ startsWith(github.ref, 'refs/tags/v') }}
87
+ name : " Create GitHub Release"
88
+ uses : actions/create-release@v1
89
+ with :
90
+ tag_name : ${{ github.ref }}
91
+ release_name : ${{ github.ref }}
92
+ draft : false
93
+ prerelease : false
94
+ files : |
95
+ dist/*.whl
96
+ dist/*.tar.gz
97
+ token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments