Skip to content

Commit ea96de0

Browse files
committed
add hg publish workflow
1 parent 1ca51f3 commit ea96de0

File tree

2 files changed

+33
-3
lines changed

2 files changed

+33
-3
lines changed

.github/workflows/publish.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: Publish python package
3+
on:
4+
release:
5+
types: [created]
6+
jobs:
7+
tests:
8+
uses: ./.github/workflows/tests.yml
9+
publish_on_pypi:
10+
runs-on: ubuntu-latest
11+
needs: [tests]
12+
environment: release
13+
permissions:
14+
id-token: write
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: '3.x'
21+
cache: pip
22+
cache-dependency-path: '**/pyproject.toml'
23+
- name: Install dependencies
24+
run: |
25+
pip install build
26+
- name: Build
27+
run: |
28+
python -m build
29+
- name: Publish
30+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: tests
2-
on: ["push", "pull_request"]
2+
on: ['push', 'pull_request', 'workflow_call']
33
jobs:
44
tests:
55
runs-on: ${{ matrix.os }}
@@ -31,8 +31,8 @@ jobs:
3131
steps:
3232
- uses: actions/checkout@v4
3333

34-
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.architecture }}
35-
uses: actions/setup-python@v4
34+
- name: Set up Python ${{ matrix.python-version }}
35+
uses: actions/setup-python@v5
3636
with:
3737
python-version: ${{ matrix.python-version }}
3838

0 commit comments

Comments
 (0)