diff --git a/.github/workflows/publish_conda.yml b/.github/workflows/publish_conda.yml new file mode 100644 index 00000000..f2939bb4 --- /dev/null +++ b/.github/workflows/publish_conda.yml @@ -0,0 +1,17 @@ +name: publish_conda + +on: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: publish-to-conda + uses: fcakyon/conda-publish-action@v1.3 + with: + subdir: 'conda' + anacondatoken: ${{ secrets.CONDA_TOKEN }} + platforms: 'win osx linux' diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index b9139c7c..356774e0 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -11,6 +11,8 @@ name: PyPi on: release: types: [published] + + workflow_dispatch: permissions: contents: read @@ -26,6 +28,9 @@ jobs: uses: actions/setup-python@v3 with: python-version: '3.x' + - name: Get the version + id: get_version + run: echo ::set-output name=${GITHUB_REF/refs\/tags\//} - name: Install dependencies run: | python -m pip install --upgrade pip @@ -37,5 +42,10 @@ jobs: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} run: | + version_tag=${GITHUB_REF/refs\/tags\//} + version_tag=${version_tag/refs\/heads\//} + # echo ${GITHUB_REF} + # echo ${version_tag} + python main/tools/pypi/update_version.py ${version_tag} python setup.py sdist bdist_wheel - twine upload */dist/idds*-${version}.tar.gz + twine upload */dist/idds*-${version_tag}.tar.gz