Skip to content

Commit 66d9c8d

Browse files
authored
Merge pull request OpenMDAO#92 from swryan/release
Added a workflow to publish to PyPi when a release is made on GitHub
2 parents 95d43d8 + b754e50 commit 66d9c8d

2 files changed

Lines changed: 41 additions & 0 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Publish release to PyPi
2+
3+
name: Publish Release
4+
5+
on:
6+
# Trigger on release, to publish release packages to PyPI
7+
release:
8+
types: [published]
9+
10+
# Run the workflow manually
11+
# This might be useful if the automated publish fails for some reason (use with CARE!!)
12+
workflow_dispatch:
13+
14+
jobs:
15+
pypi-publish:
16+
name: Upload release to PyPI
17+
runs-on: ubuntu-latest
18+
19+
environment: release
20+
21+
permissions:
22+
id-token: write
23+
24+
steps:
25+
- uses: actions/checkout@v3
26+
27+
- uses: actions/setup-python@v4
28+
with:
29+
python-version: "3.x"
30+
31+
- name: deps
32+
run: python -m pip install -U hatch
33+
34+
- name: build
35+
run: hatch build
36+
37+
- name: Publish package distributions to PyPI
38+
uses: pypa/gh-action-pypi-publish@release/v1

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
build-backend = "setuptools.build_meta"
3+
requires = ["setuptools"]

0 commit comments

Comments
 (0)