Skip to content

Commit 12e90a4

Browse files
committed
chore: add publish action to public pypi
1 parent 466fb40 commit 12e90a4

File tree

1 file changed

+32
-24
lines changed

1 file changed

+32
-24
lines changed

.github/workflows/publish.yml

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ on:
88
- published
99

1010
jobs:
11-
release:
12-
name: "Release"
11+
build:
12+
name: "Build distribution"
1313
runs-on: '${{ matrix.os }}'
1414
strategy:
1515
matrix:
@@ -22,6 +22,7 @@ jobs:
2222
# - "3.11"
2323
# - "3.12"
2424
- "3.13"
25+
2526
steps:
2627
- name: Checkout
2728
uses: actions/checkout@v4
@@ -41,31 +42,38 @@ jobs:
4142
with:
4243
python-version: ${{ matrix.python-version }}
4344

44-
- name: Azure Login
45-
uses: azure/login@v2
46-
with:
47-
# https://github.com/azure/login/tree/v2/?tab=readme-ov-file#creds
48-
creds: |
49-
{
50-
"clientId": "${{ secrets.PL_INTERNAL_TOOLS_AZ_CLIENT_ID }}",
51-
"clientSecret": "${{ secrets.PL_INTERNAL_TOOLS_AZ_CLIENT_SECRET }}",
52-
"subscriptionId": "${{ vars.PL_INTERNAL_TOOLS_AZ_CLIENT_SUB_ID }}",
53-
"tenantId": "${{ secrets.PL_INTERNAL_TOOLS_AZ_TENANT_ID }}"
54-
}
55-
56-
- name: Get Azure token
57-
run: echo "AZ_TOKEN=$(az account get-access-token --query accessToken -o tsv)" >> $GITHUB_ENV
58-
5945
- name: Restore UV environment
6046
run: cp production.uv.lock uv.lock
6147

6248
- name: Build Package
6349
run: |
64-
uv build --index https://$AZ_TOKEN@${{vars.PL_INTERNAL_PYPI_PULL_URL_NO_PROTOCOL}}
50+
uv build
6551
66-
- name: Upload
67-
run: |
68-
uv publish dist/* \
69-
-u token_user \
70-
-p $AZ_TOKEN \
71-
--publish-url ${{vars.PL_INTERNAL_PYPI_PUSH_URL}}
52+
- name: Store the distribution packages
53+
uses: actions/upload-artifact@v4
54+
with:
55+
name: python-package-distributions
56+
path: dist/
57+
58+
publish:
59+
name: "Publish distribution"
60+
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
61+
runs-on: ubuntu-latest
62+
needs: build
63+
64+
environment:
65+
name: pypi
66+
url: https://pypi.org/p/tesseract-jax
67+
68+
permissions:
69+
id-token: write
70+
71+
steps:
72+
- name: Download all the dists
73+
uses: actions/download-artifact@v4
74+
with:
75+
name: python-package-distributions
76+
path: dist/
77+
78+
- name: Publish distribution to PyPI
79+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)