v0.4.0: Evaluation metrics and PyTorch 2.0 #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: publish | |
on: | |
release: | |
types: [published] | |
jobs: | |
pypi: | |
if: "!github.event.release.prerelease" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
architecture: x64 | |
- name: Cache python modules | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-python-${{ matrix.python }}-${{ hashFiles('pyproject.toml') }}-build | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools wheel twine --upgrade | |
- name: Build and publish | |
env: | |
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
run: | | |
echo "BUILD_VERSION=${GITHUB_REF#refs/*/}" | cut -c 2- >> $GITHUB_ENV | |
python setup.py sdist bdist_wheel | |
twine check dist/* | |
twine upload dist/* | |
pypi-check: | |
if: "!github.event.release.prerelease" | |
runs-on: ubuntu-latest | |
needs: pypi | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
architecture: x64 | |
- name: Install package | |
run: | | |
python -m pip install --upgrade pip | |
pip install torchcam | |
python -c "import torchcam; print(torchcam.__version__)" | |
conda: | |
if: "!github.event.release.prerelease" | |
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.9 | |
- name: Install dependencies | |
shell: bash -el {0} | |
run: conda install -y conda-build conda-verify anaconda-client | |
- name: Build and publish | |
shell: bash -el {0} | |
env: | |
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} | |
run: | | |
echo "BUILD_VERSION=${GITHUB_REF#refs/*/}" | cut -c 2- >> $GITHUB_ENV | |
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 | |
conda-check: | |
if: "!github.event.release.prerelease" | |
runs-on: ubuntu-latest | |
needs: conda | |
steps: | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
python-version: 3.9 | |
- name: Install package | |
shell: bash -el {0} | |
run: | | |
conda install -c frgfm torchcam | |
python -c "import torchcam; print(torchcam.__version__)" |