Skip to content

Commit f4eb608

Browse files
author
spencer@primus
committed
Add publishing workflows
1 parent a31c029 commit f4eb608

3 files changed

Lines changed: 57 additions & 32 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish a release to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- "test-v*.*.*"
7+
8+
env:
9+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
10+
11+
jobs:
12+
# the tests must pass before release is to be made
13+
test:
14+
name: Run unit tests on a branch
15+
uses: avstack-lab/workflows/.github/workflows/test_on_branch_with_uv.yml@main
16+
with:
17+
branch: $BRANCH_NAME
18+
os: ubuntu-22.04
19+
python-versions: "3.10"
20+
21+
# now we run the publishing protocol
22+
publish:
23+
name: Run publishing protocol
24+
uses: avstack-lab/workflows/.github/workflows/publish_to_index.yml@main
25+
needs: test
26+
with:
27+
os: ubuntu-22.04
28+
python-version: "3.10"
29+
uv-version: "0.6.14"
30+
token: ${{ secrets.PYPI_API_TOKEN }}
31+
index: "pypi"
Lines changed: 21 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,30 @@
11
name: Publish a release to TestPyPI
22

3-
# on:
4-
# push:
5-
# tags:
6-
# - "test-v*.*.*"
7-
83
on:
94
push:
105
branches: [ test-release ]
116

7+
env:
8+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
9+
1210
jobs:
1311
# the tests must pass before release is to be made
14-
# test:
15-
# name: Run unit tests on release branch
16-
# uses: avstack-lab/workflows/.github/workflows/test_on_branch_with_uv.yml@main
17-
# with:
18-
# branch: release
19-
# os: ubuntu-22.04
20-
21-
# then we build to prep for release
22-
build:
23-
name: Build and publish the package to pypi
24-
# needs: test
25-
runs-on: ubuntu-22.04
26-
steps:
27-
- uses: actions/checkout@v4
28-
with:
29-
submodules: recursive
30-
31-
- name: Init UV and python
32-
uses: ./.github/actions/init
33-
with:
34-
python-version: "3.10"
35-
uv-version: "0.6.14"
12+
test:
13+
name: Run unit tests on a branch
14+
uses: avstack-lab/workflows/.github/workflows/test_on_branch_with_uv.yml@main
15+
with:
16+
branch: $BRANCH_NAME
17+
os: ubuntu-22.04
18+
python-versions: "3.10"
3619

37-
- name: Build
38-
run: uv build
39-
40-
- name: Publish
41-
run: uv publish --index testpypi --token ${{ secrets.TESTPYPI_API_TOKEN }} --verbose
20+
# now we run the publishing protocol
21+
publish:
22+
name: Run publishing protocol
23+
uses: avstack-lab/workflows/.github/workflows/publish_to_index.yml@main
24+
needs: test
25+
with:
26+
os: ubuntu-22.04
27+
python-version: "3.10"
28+
uv-version: "0.6.14"
29+
token: ${{ secrets.TESTPYPI_API_TOKEN }}
30+
index: "testpypi"

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ name = "pytorch-cu117"
9595
url = "https://download.pytorch.org/whl/cu117"
9696
explicit = true
9797

98+
[[tool.uv.index]]
99+
name = "pypi"
100+
url = "https://pypi.org/simple/"
101+
explicity = true
102+
98103
[[tool.uv.index]]
99104
name = "testpypi"
100105
url = "https://test.pypi.org/simple/"

0 commit comments

Comments
 (0)