From 03d716f99bbb288fd8eaf67f3438ead08bba1075 Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Tue, 29 Mar 2022 16:05:09 -0400 Subject: [PATCH] add GHA for release (#155) * add GHA for release * adapting tags in release.yml --- .github/release.yml | 17 ++++++++ .github/workflows/release_and_publish.yml | 49 +++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 .github/release.yml create mode 100644 .github/workflows/release_and_publish.yml diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 00000000..e7115c6e --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,17 @@ +changelog: + exclude: + labels: + - ignore-for-release + authors: + - octocat + - dependabot + categories: + - title: Breaking Changes 🛠 + labels: + - breaking-change + - title: Exciting New Features 🎉 + labels: + - enhancement + - title: Other Changes + labels: + - "*" diff --git a/.github/workflows/release_and_publish.yml b/.github/workflows/release_and_publish.yml new file mode 100644 index 00000000..7d6ff8eb --- /dev/null +++ b/.github/workflows/release_and_publish.yml @@ -0,0 +1,49 @@ +name: Release & Publish + +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 + workflow_dispatch: + inputs: + version: + description: Manual Release + default: test + required: false + + +jobs: + build: + name: Create release & publish to PyPI + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - name: Set up python + uses: actions/setup-python@v3 + with: + python-version: "3.x" + + - name: Install Dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine jupyter urllib3 pandas pyyaml + python setup.py sdist bdist_wheel + + - name: Create Release Notes + uses: actions/github-script@v6 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + await github.request(`POST /repos/${{ github.repository }}/releases`, { + tag_name: "${{ github.ref }}", + generate_release_notes: true + }); + + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.PYPI_PASSWORD }}