Skip to content

Commit 1abce89

Browse files
committed
Fix CI and pypi publishing
1 parent 42b9040 commit 1abce89

4 files changed

Lines changed: 75 additions & 78 deletions

File tree

.github/workflows/nox.yaml

Lines changed: 63 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ jobs:
2626
- name: Checkout
2727
uses: actions/checkout@v4
2828

29-
# - uses: ./.github/actions/uv-setup
29+
- uses: ./.github/actions/uv-setup
3030

31-
# - id: nox-sessions
32-
# run: |
33-
# sessions=$(uv run --only-group nox -- tasks/gh-nox-sessions)
34-
# echo "sessions=$sessions" >> $GITHUB_OUTPUT
35-
# env:
36-
# PYTHONPATH: './src'
31+
- id: nox-sessions
32+
run: |
33+
sessions=$(uv run --only-group nox -- tasks/gh-nox-sessions)
34+
echo "sessions=$sessions" >> $GITHUB_OUTPUT
35+
env:
36+
PYTHONPATH: './src'
3737

3838
# nox-other:
3939
# needs: generate-matrix
@@ -53,35 +53,35 @@ jobs:
5353
# nox-session: ${{ matrix.session }}
5454

5555

56-
nox-pg:
57-
needs: generate-matrix
58-
runs-on: ubuntu-24.04
56+
# nox-pg:
57+
# needs: generate-matrix
58+
# runs-on: ubuntu-24.04
5959

60-
strategy:
61-
fail-fast: false
62-
matrix:
63-
session: ${{ fromJson(needs.generate-matrix.outputs.nox-sessions).pg }}
60+
# strategy:
61+
# fail-fast: false
62+
# matrix:
63+
# session: ${{ fromJson(needs.generate-matrix.outputs.nox-sessions).pg }}
6464

65-
services:
66-
postgres:
67-
image: postgres:17
68-
env:
69-
POSTGRES_HOST_AUTH_METHOD: trust
70-
ports:
71-
- 5432:5432
72-
options: >-
73-
--health-cmd="pg_isready -U postgres"
74-
--health-interval=3s
75-
--health-timeout=3s
76-
--health-retries=15
65+
# services:
66+
# postgres:
67+
# image: postgres:17
68+
# env:
69+
# POSTGRES_HOST_AUTH_METHOD: trust
70+
# ports:
71+
# - 5432:5432
72+
# options: >-
73+
# --health-cmd="pg_isready -U postgres"
74+
# --health-interval=3s
75+
# --health-timeout=3s
76+
# --health-retries=15
7777

78-
steps:
79-
- name: Checkout
80-
uses: actions/checkout@v4
78+
# steps:
79+
# - name: Checkout
80+
# uses: actions/checkout@v4
8181

82-
- uses: ./.github/actions/nox-run
83-
with:
84-
nox-session: ${{ matrix.session }}
82+
# - uses: ./.github/actions/nox-run
83+
# with:
84+
# nox-session: ${{ matrix.session }}
8585

8686

8787
# nox-mssql:
@@ -140,3 +140,34 @@ jobs:
140140
# with:
141141
# use_oidc: true
142142
# files: ci/github-coverage/*.xml
143+
144+
pypi-publish:
145+
needs: generate-matrix
146+
runs-on: ubuntu-latest
147+
148+
env:
149+
upload-url: ${{ github.event_name == 'pull_request' && 'https://test.pypi.org/legacy/' || 'https://upload.pypi.org/legacy/' }}
150+
151+
permissions:
152+
# required for pypa/gh-action-pypi-publish
153+
id-token: write
154+
155+
steps:
156+
- name: Checkout
157+
uses: actions/checkout@v4
158+
159+
- uses: ./.github/actions/uv-setup
160+
161+
- name: Hatch build
162+
run: |
163+
uv run --only-group release -- hatch --version
164+
uv run --only-group release -- hatch build
165+
166+
- name: Uploading to
167+
run: echo ${{ env.upload-url }}
168+
169+
- name: Publish package distributions to PyPI
170+
uses: pypa/gh-action-pypi-publish@release/v1
171+
with:
172+
packages-dir: tmp/dist
173+
repository-url: ${{ env.upload-url }}

.github/workflows/pypi.yaml

Lines changed: 0 additions & 45 deletions
This file was deleted.

env-config.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
profile:
22
pypi:
33
HATCH_INDEX_USER: '__token__'
4-
HATCH_INDEX_AUTH: 'op://private/pypi.python.org/api-token'
4+
HATCH_INDEX_AUTH: 'op://my/private/pypi.org/api-token'
5+
test-pypi:
6+
HATCH_INDEX_USER: '__token__'
7+
HATCH_INDEX_AUTH: 'op://my/private/test.pypi.org/api-token'

mise.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,11 @@ description = 'Check the mssql service from our host'
4242
run = '''
4343
/opt/mssql-tools18/bin/sqlcmd -C -S 127.0.0.1 -U sa -P Docker-sa-password -Q "select 'connected' as status"
4444
'''
45+
46+
47+
[tasks.publish-test]
48+
description = 'Publish to test.pypi.org'
49+
run = [
50+
'hatch build --clean',
51+
'hatch publish -r test tmp/dist/',
52+
]

0 commit comments

Comments
 (0)