Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Fixed CI pypi automatic publish upon release #153

Merged
merged 1 commit into from
Mar 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 4 additions & 51 deletions .github/workflows/pkg-upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: pypi-publish

on:
release:
types: [published, edited]
types: [published]

jobs:

Expand Down Expand Up @@ -40,6 +40,7 @@ jobs:
run: |
VERSION="${VERSION:1}"
BUILD_VERSION=$VERSION python setup.py sdist bdist_wheel
cd dist && for f in doctr-*; do mv "$f" "python-$f"; done && cd ..
twine check dist/*
twine upload dist/*
Expand All @@ -57,53 +58,5 @@ jobs:
- name: Install package
run: |
python -m pip install --upgrade pip
pip install torchcam
python -c "import torchcam; print(torchcam.__version__)"
conda-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Miniconda setup
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: 3.7
- name: Install dependencies
run: |
conda install -y conda-build conda-verify anaconda-client
- name: Get release tag
id: release_tag
run: |
echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Anaconda login
run: |
conda install -y conda-build conda-verify anaconda-client
- name: Build and publish
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
VERSION: ${{ steps.release_tag.outputs.VERSION }}
run: |
VERSION="${VERSION:1}"
export BUILD_VERSION=$VERSION
python setup.py sdist
mkdir conda-dist
conda-build .conda/ -c pytorch --output-folder conda-dist
ls -l conda-dist/noarch/*tar.bz2
anaconda upload conda-dist/noarch/*tar.bz2 -u frgfm
conda-check:
if: "!github.event.release.prerelease"
runs-on: ubuntu-latest
needs: conda-publish
steps:
- uses: actions/checkout@v2
- name: Miniconda setup
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: 3.7
- name: Install package
run: |
conda install -c frgfm torchcam
python -c "import torchcam; print(torchcam.__version__)"
pip install python-doctr
python -c "import doctr; print(doctr.__version__)"