From eebf3b3c79b4cde9939fcd3638d09607982fef4d Mon Sep 17 00:00:00 2001 From: Milan Stute Date: Fri, 13 Dec 2019 15:08:22 +0100 Subject: [PATCH] Add release and publish workflows --- .github/workflows/createrelease.yml | 25 ++++++++++++++++++++++++ .github/workflows/pythonpublish.yml | 26 +++++++++++++++++++++++++ .github/workflows/pythonpublishtest.yml | 26 +++++++++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 .github/workflows/createrelease.yml create mode 100644 .github/workflows/pythonpublish.yml create mode 100644 .github/workflows/pythonpublishtest.yml diff --git a/.github/workflows/createrelease.yml b/.github/workflows/createrelease.yml new file mode 100644 index 0000000..255c1b0 --- /dev/null +++ b/.github/workflows/createrelease.yml @@ -0,0 +1,25 @@ +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + +name: Create Release + +jobs: + build: + name: Create Release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@master + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} # instead of GITHUB_TOKEN, otherwise relase workflows are not triggered + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false diff --git a/.github/workflows/pythonpublish.yml b/.github/workflows/pythonpublish.yml new file mode 100644 index 0000000..08daae7 --- /dev/null +++ b/.github/workflows/pythonpublish.yml @@ -0,0 +1,26 @@ +name: Upload Python Package + +on: + release: + types: [created] + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: '3.7' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build and publish on test + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/* diff --git a/.github/workflows/pythonpublishtest.yml b/.github/workflows/pythonpublishtest.yml new file mode 100644 index 0000000..3370d8a --- /dev/null +++ b/.github/workflows/pythonpublishtest.yml @@ -0,0 +1,26 @@ +name: Upload Python Test Package + +on: + release: + types: [created] + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: '3.7' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build and publish on test + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }} + run: | + python setup.py sdist bdist_wheel + twine upload --repository-url https://test.pypi.org/legacy/ dist/*