@@ -4,13 +4,16 @@ permissions:
44 contents : read
55
66on :
7- workflow_dispatch :
8- inputs :
9- release-version :
10- description : ' Release Version'
11- required : true
12- type : string
13-
7+ push :
8+ branches :
9+ - main
10+ paths :
11+ - .github/workflows/release-lit.yml
12+ - ' llvm/utils/lit/**'
13+ pull_request :
14+ paths :
15+ - .github/workflows/release-lit.yml
16+ - ' llvm/utils/lit/**'
1417 workflow_call :
1518 inputs :
1619 release-version :
2124 RELEASE_TASKS_USER_TOKEN :
2225 description : " Secret used to check user permissions."
2326 required : false
27+ workflow_dispatch :
28+ inputs :
29+ description_only :
30+ description : Workflow dispatch only triggers a dry run, no upload to PyPI will occur.
31+ type : string
32+ default : ' Please read the description above.'
33+ required : false
34+ release-version :
35+ description : ' Release Version'
36+ required : true
37+ type : string
2438
2539jobs :
2640 release-lit :
41+ if : github.repository_owner == 'llvm' || github.event_name == 'workflow_dispatch'
2742 name : Release Lit
2843 runs-on : ubuntu-24.04
2944 steps :
3853 sudo apt-get install -y python3-setuptools python3-psutil python3-github
3954
4055 - name : Check Permissions
56+ if : github.event_name == 'workflow_call'
4157 env :
4258 GITHUB_TOKEN : ${{ github.token }}
4359 USER_TOKEN : ${{ secrets.RELEASE_TASKS_USER_TOKEN }}
4763 - name : Setup Cpp
4864 uses : aminya/setup-cpp@a276e6e3d1db9160db5edc458e99a30d3b109949 # v1.7.1
4965 with :
50- compiler : llvm-16.0.6
66+ compiler : llvm-19.1.7
5167 cmake : true
5268 ninja : true
5369
@@ -65,14 +81,22 @@ jobs:
6581 sed -i 's/ + "dev"//g' lit/__init__.py
6682 python3 setup.py sdist bdist_wheel
6783
84+ - name : Save lit package as an artifact
85+ uses : actions/upload-artifact@v4
86+ with :
87+ name : lit-artifact
88+ path : llvm/utils/lit/dist/
89+
6890 - name : Upload lit to test.pypi.org
91+ if : github.event_name == 'workflow_call'
6992 uses : pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
7093 with :
7194 password : ${{ secrets.LLVM_LIT_TEST_PYPI_API_TOKEN }}
7295 repository-url : https://test.pypi.org/legacy/
7396 packages-dir : llvm/utils/lit/dist/
7497
7598 - name : Upload lit to pypi.org
99+ if : github.event_name == 'workflow_call'
76100 uses : pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
77101 with :
78102 password : ${{ secrets.LLVM_LIT_PYPI_API_TOKEN }}
0 commit comments