Skip to content

Commit dddd96d

Browse files
authored
Merge pull request #9 from mike-oakley/release-test
feat: Release config.
2 parents 713dded + 96af1ee commit dddd96d

File tree

2 files changed

+65
-29
lines changed

2 files changed

+65
-29
lines changed

.github/workflows/publish.yml

Lines changed: 64 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,71 @@
1-
name: Publish Python 🐍 distributions 📦 to PyPI
1+
name: Publish
22

33
on:
4+
push:
5+
branches:
6+
- main
47
release:
5-
types: [published]
6-
8+
types:
9+
- published
10+
711
jobs:
8-
build-n-publish:
9-
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
10-
runs-on: ubuntu-18.04
12+
build:
13+
name: Build package
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v3
18+
- name: Set up Python
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: 3.11
22+
- name: Install Poetry
23+
uses: snok/install-poetry@v1
24+
with:
25+
virtualenvs-create: false
26+
version: 1.5.0
27+
- name: Build package distribution
28+
run: poetry build
29+
- name: Upload package artifact
30+
uses: actions/upload-artifact@v3
31+
with:
32+
name: distribution
33+
path: dist
34+
test-release:
35+
name: Publish release to Test PyPI
36+
if: github.event_name != 'release'
37+
runs-on: ubuntu-latest
38+
needs: build
39+
environment:
40+
name: test
41+
url: https://test.pypi.org/p/openapi-pydantic
42+
permissions:
43+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
1144
steps:
12-
- uses: actions/checkout@master
13-
- name: Set up Python 3.7
14-
uses: actions/setup-python@v1
45+
- name: Download package distribution
46+
uses: actions/download-artifact@v3
47+
with:
48+
name: distribution
49+
path: dist
50+
- name: Publish package distribution to Test PyPI
51+
uses: pypa/gh-action-pypi-publish@release/v1
1552
with:
16-
python-version: 3.7
17-
- name: Install pypa/build
18-
run: >-
19-
python -m
20-
pip install
21-
build
22-
--user
23-
- name: Build a binary wheel and a source tarball
24-
run: >-
25-
python -m
26-
build
27-
--sdist
28-
--wheel
29-
--outdir dist/
30-
.
31-
- name: Publish distribution 📦 to PyPI
32-
if: startsWith(github.ref, 'refs/tags')
33-
uses: pypa/gh-action-pypi-publish@master
53+
repository-url: https://test.pypi.org/legacy/
54+
release:
55+
name: Publish release to PyPI
56+
if: github.event_name == 'release'
57+
runs-on: ubuntu-latest
58+
needs: build
59+
environment:
60+
name: production
61+
url: https://pypi.org/p/openapi-pydantic
62+
permissions:
63+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
64+
steps:
65+
- name: Download package distribution
66+
uses: actions/download-artifact@v3
3467
with:
35-
password: ${{ secrets.PYPI_API_TOKEN }}
68+
name: distribution
69+
path: dist
70+
- name: Publish package distribution to PyPI
71+
uses: pypa/gh-action-pypi-publish@release/v1

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "openapi-pydantic"
3-
version = "1.0.0"
3+
version = "0.1.0"
44
description = "Pydantic OpenAPI schema implementation"
55
authors = ["Mike Oakley <[email protected]>"]
66
readme = "README.md"

0 commit comments

Comments
 (0)