-
Notifications
You must be signed in to change notification settings - Fork 9
43 lines (39 loc) · 1.23 KB
/
merge.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Latest release
env:
CACHE_VERSION: 10
DEFAULT_PYTHON: "3.13"
# Only run on merges
on:
pull_request:
types: closed
branches:
- main
jobs:
publishing:
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-latest
# Only trigger on merges, not just closes
if: github.event.pull_request.merged == true
steps:
- name: Check out committed code
uses: actions/checkout@v4
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.pypi_token }}
skip-existing: true