From aebea20d5ef964e27d3d22e02e553da174fd5c12 Mon Sep 17 00:00:00 2001 From: Christian Knittl-Frank Date: Sun, 6 Jun 2021 01:06:43 +0200 Subject: [PATCH] Setup workflows --- .github/workflows/publish.yml | 34 ++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 21 +++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..ca6832a --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,34 @@ +# This workflow will upload a Python Package to PyPI when a release is published +# For more information see: +# - https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries +# - https://github.com/pypa/gh-action-pypi-publish + +name: Upload Python Package + +on: + release: + types: [published] + +jobs: + deploy: + name: Build and publish to PyPI + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.x" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install --upgrade setuptools wheel + - name: Build + run: | + python setup.py sdist bdist_wheel + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..0e70d24 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,21 @@ +# This workflow will create a release when a version tag ist pushed +# For more information see: https://github.com/softprops/action-gh-release + +name: Create GitHub Release + +on: + push: + tags: "v*.*.*" + +jobs: + deploy: + name: Create Release + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Release + uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GH_PAT }} # Private Acces Token + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Does not trigger release