Skip to content

Commit b1d7c05

Browse files
committed
CI for release
1 parent e9d33fb commit b1d7c05

2 files changed

Lines changed: 72 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,29 @@ jobs:
143143
runs-on: ubuntu-latest
144144
steps:
145145
- uses: cjw296/python-action/check-formatting@v1
146+
147+
build-and-inspect-package:
148+
needs:
149+
- tests
150+
- coverage
151+
- typing
152+
- formatting
153+
runs-on: ubuntu-latest
154+
steps:
155+
- uses: actions/checkout@v4
156+
- uses: hynek/build-and-inspect-python-package@v2
157+
158+
check-package:
159+
needs:
160+
- build-and-inspect-package
161+
runs-on: ubuntu-latest
162+
strategy:
163+
matrix:
164+
python-version:
165+
- "3.9"
166+
- "3.13"
167+
steps:
168+
- uses: cjw296/python-action/check-distributions@v1
169+
with:
170+
package: pytest_sqlalchemy
171+
python-version: ${{ matrix.python-version }}

.github/workflows/release.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: "Release"
2+
3+
on:
4+
workflow_run:
5+
workflows: [Continuous Integration]
6+
types: [completed]
7+
branches: [main]
8+
9+
jobs:
10+
check:
11+
runs-on: ubuntu-latest
12+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
13+
outputs:
14+
tag: ${{ steps.carthorse.outputs.tag }}
15+
steps:
16+
- uses: cjw296/python-action/carthorse@main
17+
id: carthorse
18+
with:
19+
check: "true"
20+
tag-format: '{version}'
21+
22+
release:
23+
runs-on: ubuntu-latest
24+
needs: check
25+
if: ${{ needs.check.outputs.tag != '' }}
26+
permissions:
27+
contents: write
28+
id-token: write
29+
steps:
30+
- name: Show tag
31+
run: echo "${{ toJson(needs.check.carthorse.outputs) }}"
32+
shell: bash
33+
34+
- name: Download packages from CI run
35+
uses: dawidd6/action-download-artifact@v9
36+
with:
37+
run_id: ${{ github.event.workflow_run.id }}
38+
name: Packages
39+
path: dist
40+
41+
- name: Publish package distributions to PyPI
42+
uses: pypa/gh-action-pypi-publish@release/v1
43+
44+
- uses: cjw296/python-action/carthorse@main
45+
with:
46+
tag-format: '{version}'

0 commit comments

Comments
 (0)