diff --git a/.github/workflows/github_release.yml b/.github/workflows/github_release.yml new file mode 100644 index 00000000..8cb7fb9d --- /dev/null +++ b/.github/workflows/github_release.yml @@ -0,0 +1,25 @@ +on: + push: + # Sequence of patterns matched against refs/tags + tags: + types: [created] + + name: Create Release + + jobs: + build: + name: Create Release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + body_path: + draft: false + prerelease: false \ No newline at end of file diff --git a/.github/workflows/github_to_pypi.yml b/.github/workflows/github_to_pypi.yml new file mode 100644 index 00000000..3bd2eb89 --- /dev/null +++ b/.github/workflows/github_to_pypi.yml @@ -0,0 +1,31 @@ +# This workflows will upload a Python Package using Twine when a release is created +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + +name: Upload Python Package + +on: + release: + types: [created] + +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - 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 setuptools wheel twine + - name: Build and publish + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/* \ No newline at end of file diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml new file mode 100644 index 00000000..474e6d3d --- /dev/null +++ b/.github/workflows/pypi.yml @@ -0,0 +1,6 @@ +- name: Publish package + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.SHARAD_PYPI_PASSWORD }} \ No newline at end of file