-
Notifications
You must be signed in to change notification settings - Fork 16
42 lines (35 loc) · 1.54 KB
/
build.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
name: Build
on:
# TODO Can we make this workflow depend on unittests to avoid building broken packages?
# As it seems: no, we cannot. At least not really. Jobs can depend on other jobs, but workflows
# cannot depend on other workflows. But jobs cannot be triggered by events, only workflows are
# triggered by events. That means we would need to run the build/upload job for every commit
# and every Python version and then check if it is the right Python version and if there is a
# new tag and only then really upload a package.
# The only additional advantage of this approach might be that we could test the package
# building process for every commit and every Python version comfortably.
#
# Note: building the package is also tested in unittests.yml.
#
# https://github.community/t/how-do-i-specify-job-dependency-running-in-another-workflow/16482/2
# https://docs.github.com/en/actions/learn-github-actions/managing-complex-workflows#creating-dependent-jobs
push:
tags:
- v*
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Build a binary wheel and a source tarball
run: python setup.py bdist_wheel
- name: Publish distribution package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}