-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (46 loc) · 1.49 KB
/
Copy pathpublish.yaml
File metadata and controls
55 lines (46 loc) · 1.49 KB
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
name: Publish Python 🐍 distributions 📦 to PyPI
on:
push:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
pypi-publish:
# Only run publishing when the commit message contains [bumpversion]
if: "contains(github.event.head_commit.message, '[bumpversion]')"
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/meddlr
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
env:
commitmsg: ${{ github.event.head_commit.message }}
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip
- name: Print commit message
run: echo "Commit MSG = ${commitmsg}"
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install torch torchvision torchmetrics
pip install twine
make dev
pip install -e '.[alldev]'
- name: Build
run: |
python setup.py sdist bdist_wheel --universal
twine check dist/*
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true