Skip to content

upload-to-pypi

upload-to-pypi #41

name: upload-to-pypi
on:
create:
tags:
- "*"
env:
WORKSPACE_PREFIX: $(echo $GITHUB_WORKSPACE |cut -d '/' -f 1-4)
SLURM_PARTITION: llm_s
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
jobs:
build-and-upload:
runs-on: [t_cluster]
steps:
- name: mask env
run: |
echo "::add-mask::${{env.WORKSPACE_PREFIX}}"
echo "::add-mask::$path_prefix"
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: install dependencies
run: |
pip install setuptools wheel twine
- name: get latest tag
run: |
latest_tag=$(git describe --tags --abbrev=0)
echo "$latest_tag" > version.txt
- name: build and upload package
run: |
export PYTHONPATH=$PWD:$PYTHONPATH
source /mnt/petrelfs/share_data/llm_env/env/llm-flash2.0
srun -p ${SLURM_PARTITION} --kill-on-bad-exit=1 --job-name=internlm-ut-${GITHUB_RUN_ID}-${GITHUB_JOB} -N 1 -n 1 --gres=gpu:1 python setup.py sdist bdist_wheel
twine upload -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} dist/*