Skip to content

Commit 9c55a70

Browse files
committed
feat: Release config.
1 parent 713dded commit 9c55a70

File tree

2 files changed

+63
-29
lines changed

2 files changed

+63
-29
lines changed

.github/workflows/publish.yml

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

33
on:
4+
push:
5+
branches:
6+
- main
7+
- release-test
48
release:
5-
types: [published]
6-
9+
types:
10+
- published
11+
712
jobs:
8-
build-n-publish:
9-
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
10-
runs-on: ubuntu-18.04
13+
build:
14+
name: Build package
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v3
19+
- name: Set up Python
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: 3.11
23+
- name: Install Poetry
24+
uses: snok/install-poetry@v1
25+
with:
26+
virtualenvs-create: false
27+
version: 1.5.0
28+
- name: Build package distribution
29+
run: poetry build
30+
- name: Upload package artifact
31+
uses: actions/upload-artifact@v3
32+
with:
33+
name: distribution
34+
path: dist
35+
test-release:
36+
name: Publish release to Test PyPI
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+
- name: Publish package distribution to Test PyPI
50+
uses: pypa/gh-action-pypi-publish@release/v1
1551
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
52+
repository-url: https://test.pypi.org/legacy/
53+
release:
54+
name: Publish release to PyPI
55+
if: github.event_name == 'release'
56+
runs-on: ubuntu-latest
57+
needs: build
58+
environment:
59+
name: production
60+
url: https://pypi.org/p/openapi-pydantic
61+
permissions:
62+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
63+
steps:
64+
- name: Download package distribution
65+
uses: actions/download-artifact@v3
3466
with:
35-
password: ${{ secrets.PYPI_API_TOKEN }}
67+
name: distribution
68+
- name: Publish package distribution to PyPI
69+
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)