-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (49 loc) · 1.49 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
62
63
name: Upload Python Package to PyPI and Deploy Documentation to Read the Docs
on:
release:
types: [created]
jobs:
pypi-publish:
name: Publish release to PyPI and Deploy Documentation
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.12"
- name: Install Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
- name: Initialize Conda
run: |
conda init bash
shell: bash
- name: Create Conda environment
run: |
conda env create -f environment.yaml
- name: Activate Conda environment
run: |
source ~/.bashrc
conda activate MED3pa
shell: bash
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel setuptools-scm sphinx sphinx_rtd_theme
- name: Clean dist directory
run: |
rm -rf dist/
- name: Build package
run: |
python setup.py sdist bdist_wheel # Could also be python -m build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://upload.pypi.org/legacy/
skip-existing: true