Skip to content

Commit

Permalink
Add PyPi publish step to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
hassec committed Oct 30, 2023
1 parent 6f0e5c8 commit 6050f4a
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/workflow_actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
# Triggers the workflow on push or pull request events but only for the "main" branch
pull_request: []
push:
tags:
- '*'
branches:
- 'main'
# Allows you to run this workflow manually from the Actions tab
Expand Down Expand Up @@ -111,3 +113,39 @@ jobs:
poetry run make doctest
poetry run make linkcheck
build_release:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs: build
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3

- name: Install Poetry
run: curl -sSL https://install.python-poetry.org | python - --version 1.6.1

- name: Poetry build
run: poetry build

- uses: actions/upload-artifact@v3
with:
name: pypi-build
path: ./dist

publish:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs: build_release
runs-on: ubuntu-22.04
environment:
name: pypi-publish
url: https://pypi.org/project/cfspopcon/
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/download-artifact@v3

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: pypi-build/
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ name = "cfspopcon"
version = "4.0.0"
description = "Empirically-derived scoping of tokamak operational space."
authors = ["Commonwealth Fusion Systems"]
readme = "README.md"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
Expand Down

0 comments on commit 6050f4a

Please sign in to comment.