Skip to content

Commit c6245d9

Browse files
committed
only run internal tests before publishing
1 parent 31695c0 commit c6245d9

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- v2.*
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Set up Python 3.12
14+
uses: actions/setup-python@v5
15+
with:
16+
python-version: 3.12
17+
- name: Install dependencies
18+
run: |
19+
python -m pip install --upgrade pip
20+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
21+
pip install -e .
22+
- name: Lint with flake8
23+
run: |
24+
flake8 .
25+
- name: Run internal tests
26+
run: |
27+
pytest tests/agrirouter/internal --junitxml=junit/test-results.xml
28+
- name: Build a binary wheel and a source tarball
29+
run: python3 -m build
30+
- name: Store the distribution packages
31+
uses: actions/upload-artifact@v3
32+
with:
33+
name: python-package-distributions
34+
path: dist/
35+
36+
publish-to-testpypi:
37+
name: Publish Python 🐍 distribution 📦 to TestPyPI
38+
needs:
39+
- build
40+
runs-on: ubuntu-latest
41+
42+
environment:
43+
name: testpypi
44+
url: https://test.pypi.org/p/agrirouter
45+
46+
permissions:
47+
id-token: write # IMPORTANT: mandatory for trusted publishing
48+
49+
steps:
50+
- name: Download all the dists
51+
uses: actions/download-artifact@v3
52+
with:
53+
name: python-package-distributions
54+
path: dist/
55+
- name: Publish distribution 📦 to TestPyPI
56+
uses: pypa/gh-action-pypi-publish@release/v1
57+
with:
58+
repository-url: https://test.pypi.org/legacy/
59+

0 commit comments

Comments
 (0)