Skip to content

Commit 62d46e8

Browse files
authored
Merge pull request #21 from rom1504/packaging
Add github action to automatically push to pypi on Release x.y.z commit
2 parents 987f898 + eb6a76f commit 62d46e8

File tree

7 files changed

+47
-9
lines changed

7 files changed

+47
-9
lines changed

Diff for: .github/workflows/python-publish.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions-ecosystem/action-regex-match@v2
13+
id: regex-match
14+
with:
15+
text: ${{ github.event.head_commit.message }}
16+
regex: '^Release ([^ ]+)'
17+
- name: Set up Python
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: '3.8'
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install setuptools wheel twine
25+
- name: Release
26+
if: ${{ steps.regex-match.outputs.match != '' }}
27+
uses: softprops/action-gh-release@v1
28+
with:
29+
tag_name: v${{ steps.regex-match.outputs.group1 }}
30+
- name: Build and publish
31+
if: ${{ steps.regex-match.outputs.match != '' }}
32+
env:
33+
TWINE_USERNAME: __token__
34+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
35+
run: |
36+
python setup.py sdist bdist_wheel
37+
twine upload dist/*

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ __pycache__
55
out*
66
*.egg-info
77
*.ini
8+
.env

Diff for: .gitmodules

-3
This file was deleted.

Diff for: CLIP

-1
This file was deleted.

Diff for: README.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@ The models are denoising diffusion probabilistic models (https://arxiv.org/abs/2
66

77
Thank you to [stability.ai](https://www.stability.ai) for compute to train these models!
88

9-
## Dependencies
9+
## Installation
1010

11-
- PyTorch ([installation instructions](https://pytorch.org/get-started/locally/))
11+
`pip install v-diffusion-pytorch`
1212

13-
- requests, tqdm (install with `pip install`)
14-
15-
- CLIP (https://github.com/openai/CLIP), and its additional pip-installable dependencies: ftfy, regex. **If you `git clone --recursive` this repo, it should fetch CLIP automatically.**
13+
or git clone then `pip install -e .`
1614

1715
## Model checkpoints:
1816

Diff for: requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ Pillow
55
torch
66
torchvision
77
tqdm
8+
clip-anytorch

Diff for: setup.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from setuptools import setup
2+
3+
4+
if __name__ == '__main__':
5+
setup()

0 commit comments

Comments
 (0)