-
Notifications
You must be signed in to change notification settings - Fork 39
61 lines (50 loc) · 1.49 KB
/
upload-pypi.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
name: Upload to PyPI
on:
release:
types:
- published
workflow_dispatch:
inputs:
pypi_repo:
description: 'Repo to upload to (testpypi or pypi)'
default: 'pypi'
required: true
type: choice
options:
- testpypi
- pypi
jobs:
build_wheels:
uses: ./.github/workflows/wheel.yml
build_sdist:
runs-on: ubuntu-latest
container: ghcr.io/iith-compilers/manylinux2014-llvm/manylinux2014-llvm:x86-llvm17
steps:
- uses: actions/checkout@v3
- name: Build IR2Vec
run: bash Manylinux2014_Compliant_Source/pkg/build.sh
- name: Build sdist
run: cd Manylinux2014_Compliant_Source/pkg && pipx run build --sdist
- uses: actions/upload-artifact@v3
with:
path: Manylinux2014_Compliant_Source/pkg/dist/*.tar.gz
upload_pypi:
permissions:
id-token: write
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- name: Publish package to TestPyPI
uses: pypa/[email protected]
with:
repository-url: https://test.pypi.org/legacy/
if: ${{ github.event.inputs.pypi_repo != 'pypi' }}
- name: Publish package to PyPI
uses: pypa/[email protected]
with:
repository-url: https://upload.pypi.org/legacy/
if: ${{ github.event.inputs.pypi_repo == 'pypi' }}