-
Notifications
You must be signed in to change notification settings - Fork 51
64 lines (51 loc) · 1.49 KB
/
deploy.yaml
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
62
63
64
name: Build and upload to PyPI
on:
push:
branches:
- master
tags:
- "*"
release:
types:
- published
concurrency:
group: "${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}"
cancel-in-progress: true
defaults:
run:
shell: bash -l {0}
jobs:
build_wheels:
environment: deploy
if: "github.repository == 'alchemistry/alchemlyb'"
name: Build pure Python wheel and tarball
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: setup_miniconda
uses: conda-incubator/setup-miniconda@v2
with:
python-version: "3.10"
auto-update-conda: true
add-pip-as-python-dependency: true
architecture: x64
- name: install_deps
run: |
python -m pip install build
- name: build
run: |
python -m build --sdist --wheel --outdir dist/
- name: publish_testpypi
# Upload to testpypi on every tag
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: publish_pypi
if: github.event_name == 'release' && github.event.action == 'published'
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}