Skip to content

Commit

Permalink
Use different token for GPU packages
Browse files Browse the repository at this point in the history
  • Loading branch information
vietanhdev committed Dec 18, 2023
1 parent 7f8a917 commit e7fb9ca
Showing 1 changed file with 7 additions and 22 deletions.
29 changes: 7 additions & 22 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
on:
push:
tags:
- 'v*'
- 'v*'

permissions:
id-token: write
Expand All @@ -22,21 +22,13 @@ jobs:
python-version: "3.x"
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
python -m pip install build --user
- name: Set preferred device to CPU
run: >-
sed -i'' -e 's/\_\_preferred_device\_\_[ ]*=[ ]*\"[A-Za-z0-9]*\"/__preferred_device__ = "CPU"/g' anylabeling/app_info.py
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
python -m build --sdist --wheel --outdir dist/ .
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@v1.8.5
with:
Expand All @@ -63,29 +55,22 @@ jobs:
python-version: "3.x"
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
python -m pip install build --user
- name: Set preferred device to GPU
run: >-
sed -i'' -e 's/\_\_preferred_device\_\_[ ]*=[ ]*\"[A-Za-z0-9]*\"/__preferred_device__ = "GPU"/g' anylabeling/app_info.py
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--wheel
--outdir dist/
.
python -m build --wheel --outdir dist/ .
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@v1.8.5
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
password: ${{ secrets.GPU_TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
skip_existing: true
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@v1.8.5
with:
password: ${{ secrets.PYPI_API_TOKEN }}
password: ${{ secrets.GPU_PYPI_API_TOKEN }}
skip_existing: true

0 comments on commit e7fb9ca

Please sign in to comment.