Skip to content

Commit

Permalink
Publish package to PyPi and GitHub Releases (#47)
Browse files Browse the repository at this point in the history
* Publish package to PyPi and GitHub Releases
* Recommend installing from pypi
* Closes #12 #15 #20
  • Loading branch information
kousu committed May 18, 2022
1 parent 913b218 commit 87c4e3a
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
40 changes: 40 additions & 0 deletions .github/workflows/publish.yml
@@ -0,0 +1,40 @@
# ref: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Publish Package

on:
# publish from the Releases page:
release:
types: [published]

jobs:
publish:
name: Publish Package

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v3

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build
run: python -m build

- name: Publish to Github
uses: softprops/action-gh-release@v1
with:
files: 'dist/*'
fail_on_unmatched_files: true
prerelease: ${{ contains(github.ref, 'rc') || contains(github.ref, 'dev') }}

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -25,8 +25,9 @@ In this repo, we implement an easy-to-use PyTorch sampler `ImbalancedDatasetSamp
## Usage

For a simple start install the package via one of following ways:

```bash
pip install https://github.com/ufoym/imbalanced-dataset-sampler/archive/master.zip
pip install torchsampler
```


Expand Down

0 comments on commit 87c4e3a

Please sign in to comment.