File tree Expand file tree Collapse file tree 1 file changed +24
-3
lines changed
Expand file tree Collapse file tree 1 file changed +24
-3
lines changed Original file line number Diff line number Diff line change 66permissions :
77 contents : read
88jobs :
9- test :
9+ release :
1010 runs-on : ubuntu-latest
1111 name : Release to PyPi
1212 steps :
1313 - uses : actions/checkout@v3
14+ - name : Fetch all branches
15+ run : git fetch --prune --unshallow
16+ - name : Check if commit is on allowed branch
17+ run : |
18+ if git branch -r --contains ${{ github.sha }} | grep -Eq 'origin/master|origin/polygon-lts'; then
19+ echo "Allowed branch"
20+ else
21+ echo "Commit not on master or polygon-lts; skipping"
22+ exit 1
23+ fi
1424 - name : Setup Python
1525 uses : actions/setup-python@v3
1626 with :
1727 python-version : " 3.10"
1828 - name : Setup Poetry
1929 uses : abatilo/actions-poetry@v2
30+ - name : Get package name
31+ id : package
32+ run : echo "name=$(poetry run python -c 'import toml; print(toml.load(\"pyproject.toml\")[\"tool\"][\"poetry\"][\"name\"])')" >> $GITHUB_OUTPUT
2033 - name : Configure Poetry
21- run : poetry config pypi-token.pypi ${{ secrets.POETRY_HTTP_BASIC_PYPI_PASSWORD }}
22- - name : Install pypi deps
34+ run : |
35+ if [ "${{ steps.package.outputs.name }}" == "polygon-api-client" ]; then
36+ poetry config pypi-token.pypi ${{ secrets.POETRY_HTTP_BASIC_PYPI_PASSWORD }}
37+ elif [ "${{ steps.package.outputs.name }}" == "massive" ]; then
38+ poetry config pypi-token.pypi ${{ secrets.POETRY_HTTP_BASIC_PYPI_PASSWORD_MASSIVE }}
39+ else
40+ echo "Unknown package name: ${{ steps.package.outputs.name }}; skipping publish"
41+ exit 1
42+ fi
43+ - name : Install deps
2344 run : poetry install
2445 - name : Get tag
2546 id : tag
You can’t perform that action at this time.
0 commit comments