-
Notifications
You must be signed in to change notification settings - Fork 11
40 lines (32 loc) · 975 Bytes
/
Copy pathbuild-package.yml
File metadata and controls
40 lines (32 loc) · 975 Bytes
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
name: Build and Publish Package
on:
push:
tags:
- "v*"
jobs:
build-and-publish-package:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set Up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Dependencies
run: |
pip install build setuptools-scm twine
conda install -c conda-forge conda-build anaconda-client
- name: Get Version
id: get_version
run: |
echo "version=$(python -c 'import setuptools_scm; print(setuptools_scm.get_version())')" >> $GITHUB_ENV
env:
GITHUB_ENV: ${{ github.env }}
- name: Build Python Package
run: python -m build
- name: Publish to PyPI
run: python -m twine upload dist/* --verbose
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}