File tree Expand file tree Collapse file tree 1 file changed +37
-1
lines changed Expand file tree Collapse file tree 1 file changed +37
-1
lines changed Original file line number Diff line number Diff line change 55 branches :
66 - main
77 pull_request :
8+ release :
9+ types : [created]
10+
11+ env :
12+ REGISTRY_NAME : ${{ vars.REGISTRY_NAME }}
13+ REGISTRY_URI : ${{ vars.REGISTRY_URI }}
814
915jobs :
1016 build :
3743 path : htmlcov/
3844 - name : SonarCloud Scan
3945 uses : SonarSource/sonarcloud-github-action@master
40- if : ${{ matrix.python-version == '3.11' }}
46+ if : ${{ matrix.python-version == '3.11' && env.SONAR_TOKEN != '' }}
4147 env :
4248 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
4349 SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
50+
51+ publish :
52+ if : github.event_name == 'release'
53+ runs-on : ubuntu-latest
54+ needs : build
55+
56+ steps :
57+ - uses : actions/checkout@v3
58+ - name : Set up Python 3.11
59+ uses : actions/setup-python@v4
60+ with :
61+ python-version : 3.11
62+ - name : Install poetry
63+ run : |
64+ curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.4.2 python3 -
65+ - name : Update version in pyproject.toml
66+ run : |
67+ echo $GITHUB_REF_NAME | sed 's/^v//' | xargs poetry version
68+ - name : Install dependencies
69+ run : |
70+ poetry install
71+ - name : Registry config
72+ run : |
73+ poetry config repositories.$REGISTRY_NAME $REGISTRY_URI
74+ poetry config pypi-token.$REGISTRY_NAME $PYPI_TOKEN
75+ env :
76+ PYPI_TOKEN : ${{ secrets.PYPI_TOKEN }}
77+ - name : Publish package to pypi
78+ run : |
79+ poetry publish --build --repository $REGISTRY_NAME
You can’t perform that action at this time.
0 commit comments