Skip to content

Commit

Permalink
Pypi release (#1131)
Browse files Browse the repository at this point in the history
* pypi upload

* try to get releasenote generation working on rtd

* News fragment

---------

Co-authored-by: Krisztian Notaisz <[email protected]>
  • Loading branch information
kn-ms and kn-ms authored Sep 9, 2024
1 parent 30e6708 commit 2b91ce7
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 4 deletions.
40 changes: 36 additions & 4 deletions .github/workflows/cut_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ jobs:
with:
python-version: '3.11'

- run: pip install --upgrade bumpver
- run: pip install --upgrade pip
- run: pip install bumpver
- run: pip install ./releaseherald

- name: git setup
run: |
git config user.name "Github Version Updater"
git config user.email "<>"
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- run: bumpver update
- run: bumpver show --env > new-version.txt
- run: releaseherald generate --latest --no-update -t news.rst
Expand All @@ -41,17 +42,48 @@ jobs:
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- run: git pull origin
- uses: ./.github/actions/build-package
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: package
path: dist/

publish:
runs-on: ubuntu-latest
needs: [cut-new-version, build]
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
sparse-checkout: |
.github
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: new-version
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: package
path: dist/

- name: Get Version
id: get_version
run: |
eval $(cat new-version.txt)
echo "new_version=${CURRENT_VERSION}" >> $GITHUB_OUTPUT
- uses: ./.github/actions/build-package
- uses: ./.github/actions/create-release
with:
tag_name: ${{ steps.get_version.outputs.new_version }}
package: dist/testplan-${{ steps.get_version.outputs.new_version }}-py3-none-any.whl
news: news.rst

- name: Publish to Test PyPI
if: ${{github.ref_name == 'test_pypi'}}
uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 # v1.9.0
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
- name: Publish to PyPI
if: ${{github.ref_name != 'test_pypi'}}
uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 # v1.9.0
with:
password: ${{ secrets.PYPI_API_TOKEN }}
3 changes: 3 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ build:
os: ubuntu-22.04
tools:
python: "3.7"
jobs:
post_checkout:
- git fetch --unshallow || true

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand Down
1 change: 1 addition & 0 deletions doc/newsfragments/1689_new.first_official_pypi_release.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
First official pypi release.

0 comments on commit 2b91ce7

Please sign in to comment.