Skip to content

Commit 7dc9a06

Browse files
authored
enable publishing workflow (#5)
1 parent 3485a74 commit 7dc9a06

File tree

1 file changed

+50
-51
lines changed

1 file changed

+50
-51
lines changed

.github/workflows/python-publish.yml

+50-51
Original file line numberDiff line numberDiff line change
@@ -7,56 +7,55 @@
77

88
# name: Upload Python Package
99

10-
# on:
11-
# release:
12-
# types: [created, edited]
10+
on:
11+
release:
12+
types: [ created, edited ]
1313

14-
# jobs:
15-
# tests:
16-
# if: startsWith(github.ref, 'refs/tags/v')
17-
# runs-on: ${{ matrix.os }}
18-
# strategy:
19-
# matrix:
20-
# python-version: ["3.12"]
21-
# os: [ubuntu-latest]
22-
# steps:
23-
# - uses: actions/checkout@v4
24-
# - name: Set up Python ${{ matrix.python-version }}
25-
# uses: actions/setup-python@v5
26-
# with:
27-
# python-version: ${{ matrix.python-version }}
28-
# - name: Install tox
29-
# run: |
30-
# python -m pip install --upgrade pip
31-
# pip install tox
32-
# - name: Run tox
33-
# run: |
34-
# tox
35-
36-
# build-n-publish:
37-
# name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
38-
# runs-on: ubuntu-latest
39-
# # Specifying a GitHub environment, # Specifying a GitHub environment, which is strongly recommended by PyPI: https://docs.pypi.org/trusted-publishers/adding-a-publisher/
40-
# # you have to create an environment in your repository settings and add the environment name here
41-
# environment: release
42-
# permissions:
43-
# # IMPORTANT: this permission is mandatory for trusted publishing
44-
# id-token: write
45-
# needs: tests
46-
# steps:
47-
# - uses: actions/checkout@v4
48-
# - name: Set up Python
49-
# uses: actions/setup-python@v5
50-
# with:
51-
# python-version: ${{ matrix.python-version }}
52-
# - name: Install dependencies
53-
# run: |
54-
# python -m pip install --upgrade pip
55-
# pip install -r dev_requirements/requirements-packaging.txt
56-
# - name: Build wheel and source distributions
57-
# run: |
58-
# python -m build
59-
# - name: Publish distribution 📦 to PyPI
60-
# if: startsWith(github.ref, 'refs/tags/v')
61-
# uses: pypa/gh-action-pypi-publish@release/v1
14+
jobs:
15+
tests:
16+
if: startsWith(github.ref, 'refs/tags/v')
17+
runs-on: ${{ matrix.os }}
18+
strategy:
19+
matrix:
20+
python-version: [ "3.12" ]
21+
os: [ ubuntu-latest ]
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Set up Python ${{ matrix.python-version }}
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
- name: Install tox
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install tox
32+
- name: Run tox
33+
run: |
34+
tox
6235
36+
build-n-publish:
37+
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
38+
runs-on: ubuntu-latest
39+
# Specifying a GitHub environment, # Specifying a GitHub environment, which is strongly recommended by PyPI: https://docs.pypi.org/trusted-publishers/adding-a-publisher/
40+
# you have to create an environment in your repository settings and add the environment name here
41+
environment: release
42+
permissions:
43+
# IMPORTANT: this permission is mandatory for trusted publishing
44+
id-token: write
45+
needs: tests
46+
steps:
47+
- uses: actions/checkout@v4
48+
- name: Set up Python
49+
uses: actions/setup-python@v5
50+
with:
51+
python-version: ${{ matrix.python-version }}
52+
- name: Install dependencies
53+
run: |
54+
python -m pip install --upgrade pip
55+
pip install -r dev_requirements/requirements-packaging.txt
56+
- name: Build wheel and source distributions
57+
run: |
58+
python -m build
59+
- name: Publish distribution 📦 to PyPI
60+
if: startsWith(github.ref, 'refs/tags/v')
61+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)