From 6b0cda59b04640f993ac5a1bbf39b1174cd0e729 Mon Sep 17 00:00:00 2001 From: Xiangyu Wang Date: Mon, 28 Jun 2021 18:14:34 +0800 Subject: [PATCH] Update Package GitHub Actions Signed-off-by: Xiangyu Wang --- .github/workflows/publish_dev_package.yml | 43 +++++++++++++++++++ ...ackage.yml => publish_release_package.yml} | 13 ++---- 2 files changed, 46 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/publish_dev_package.yml rename .github/workflows/{package.yml => publish_release_package.yml} (72%) diff --git a/.github/workflows/publish_dev_package.yml b/.github/workflows/publish_dev_package.yml new file mode 100644 index 000000000..89089dfda --- /dev/null +++ b/.github/workflows/publish_dev_package.yml @@ -0,0 +1,43 @@ +name: Publish Python 🐍 distributions 📦 to TestPyPI + +on: + push: + branches: + - 'master' +t +jobs: + build-n-publish: + name: Build and publish Python 🐍 distributions 📦 to TestPyPI + runs-on: ubuntu-18.04 + + steps: + - name: Check out from Git + uses: actions/checkout@master + - name: Get history and tags for SCM versioning + run: | + git fetch --prune --unshallow + git fetch --depth=1 origin +refs/tags/*:refs/tags/* + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + - name: Install pypa/build + run: >- + python -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: >- + python -m + build + --sdist + --wheel + --outdir dist/ + . + - name: Publish distribution 📦 to Test PyPI + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.TOKEN_TEST_PYPI }} + repository_url: https://test.pypi.org/legacy/ + diff --git a/.github/workflows/package.yml b/.github/workflows/publish_release_package.yml similarity index 72% rename from .github/workflows/package.yml rename to .github/workflows/publish_release_package.yml index 3b90bd692..d6821e408 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/publish_release_package.yml @@ -1,14 +1,12 @@ -name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI +name: Publish Python 🐍 distributions 📦 to PyPI on: push: - branches: - - 'master' tags: - - 'v[0-9]+.[0-9]+.[0-9]+**' + - 'v2.[0-9]+.[0-9]+**' jobs: build-n-publish: - name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI + name: Build and publish Python 🐍 distributions 📦 to PyPI runs-on: ubuntu-18.04 steps: @@ -36,11 +34,6 @@ jobs: --wheel --outdir dist/ . - - name: Publish distribution 📦 to Test PyPI - uses: pypa/gh-action-pypi-publish@master - with: - password: ${{ secrets.TOKEN_TEST_PYPI }} - repository_url: https://test.pypi.org/legacy/ - name: Publish distribution 📦 to PyPI if: startsWith(github.ref, 'refs/tags') uses: pypa/gh-action-pypi-publish@master