-
Notifications
You must be signed in to change notification settings - Fork 30
61 lines (48 loc) · 1.53 KB
/
publish.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Publish
on:
push:
# Allow job to be triggered manually.
workflow_dispatch:
# Cancel in-progress jobs when pushing to the same branch.
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Acquire sources
uses: actions/checkout@v3
# Fixup for `setuptools_scm`
# https://github.com/pypa/setuptools_scm/issues/480
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
cache-dependency-path: 'setup.cfg'
- name: Install pypa/build
run: pip install build
- name: Build a binary wheel and a source tarball
run: python -m build
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip_existing: true
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip_existing: true
password: ${{ secrets.PYPI_TOKEN }}
#- name: publish-to-conda
# if: startsWith(github.ref, 'refs/tags')
# uses: m0nhawk/conda-package-publish-action@master
# with:
# subDir: './conda'
# AnacondaUsername: ${{ secrets.ANACONDA_USERNAME }}
# AnacondaPassword: ${{ secrets.ANACONDA_PASSWORD }}