Skip to content

Commit 6b3e071

Browse files
authored
πŸ§™β€β™‚οΈ Initial Project Setup (#2)
1 parent 24f7239 commit 6b3e071

16 files changed

+2038
-357
lines changed

β€Ž.github/workflows/python-publish.yml

+55-56
Original file line numberDiff line numberDiff line change
@@ -5,62 +5,61 @@
55
# This workflow uploads a Python Package using Twine when a release is created.
66
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
77

8-
# name: Upload Python Package
8+
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: ${{ matrix.os }}
39-
# strategy:
40-
# matrix:
41-
# python-version: [ "3.12" ]
42-
# os: [ ubuntu-latest ]
43-
# # Specifying a GitHub environment, # Specifying a GitHub environment, which is strongly recommended by PyPI: https://docs.pypi.org/trusted-publishers/adding-a-publisher/
44-
# # you have to create an environment in your repository settings and add the environment name here
45-
# environment: release
46-
# permissions:
47-
# # IMPORTANT: this permission is mandatory for trusted publishing
48-
# id-token: write
49-
# needs: tests
50-
# steps:
51-
# - uses: actions/checkout@v4
52-
# - name: Set up Python ${{ matrix.python-version }}
53-
# uses: actions/setup-python@v5
54-
# with:
55-
# python-version: ${{ matrix.python-version }}
56-
# - name: Install dependencies
57-
# run: |
58-
# python -m pip install --upgrade pip
59-
# pip install -r dev_requirements/requirements-packaging.txt
60-
# - name: Build wheel and source distributions
61-
# run: |
62-
# python -m build
63-
# - name: Publish distribution πŸ“¦ to PyPI
64-
# if: startsWith(github.ref, 'refs/tags/v')
65-
# 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
6635
36+
build-n-publish:
37+
name: Build and publish Python 🐍 distributions πŸ“¦ to PyPI and TestPyPI
38+
runs-on: ${{ matrix.os }}
39+
strategy:
40+
matrix:
41+
python-version: [ "3.12" ]
42+
os: [ ubuntu-latest ]
43+
# Specifying a GitHub environment, # Specifying a GitHub environment, which is strongly recommended by PyPI: https://docs.pypi.org/trusted-publishers/adding-a-publisher/
44+
# you have to create an environment in your repository settings and add the environment name here
45+
environment: release
46+
permissions:
47+
# IMPORTANT: this permission is mandatory for trusted publishing
48+
id-token: write
49+
needs: tests
50+
steps:
51+
- uses: actions/checkout@v4
52+
- name: Set up Python ${{ matrix.python-version }}
53+
uses: actions/setup-python@v5
54+
with:
55+
python-version: ${{ matrix.python-version }}
56+
- name: Install dependencies
57+
run: |
58+
python -m pip install --upgrade pip
59+
pip install -r dev_requirements/requirements-packaging.txt
60+
- name: Build wheel and source distributions
61+
run: |
62+
python -m build
63+
- name: Publish distribution πŸ“¦ to PyPI
64+
if: startsWith(github.ref, 'refs/tags/v')
65+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
Β (0)