Skip to content

Commit

Permalink
CI: Update to trusted publisher workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mferrera committed Sep 24, 2024
1 parent c7bb99d commit baa84bd
Showing 1 changed file with 29 additions and 17 deletions.
46 changes: 29 additions & 17 deletions .github/workflows/fmuconfig-publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,37 @@
name: Publish Python 🐍 distributions 📦 to PyPI
name: Publish to PyPI

on:
release:
types: [created]
types: [published]

jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/subscript
permissions:
id-token: write

steps:
- uses: actions/checkout@master
- name: Set up Python 3.8
uses: actions/setup-python@v1
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install dependencies
run: pip install --upgrade setuptools wheel twine
- name: Build package
run: python setup.py sdist bdist_wheel
- name: Upload deploy
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_SECRET }}
run: python -m twine upload dist/*
python-version: 3.11

- name: Install build dependencies
run: |
pip install -U pip
pip install build
- name: Build distributions
run: python -m build

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit baa84bd

Please sign in to comment.