Skip to content

Commit

Permalink
Use trusted publisher for releases (#2646)
Browse files Browse the repository at this point in the history
* update release.yaml

* update release notes

* Update .github/workflows/release.yaml

Co-authored-by: Gaurav Sheni <[email protected]>

---------

Co-authored-by: Gaurav Sheni <[email protected]>
  • Loading branch information
thehomebrewnerd and gsheni authored Feb 8, 2024
1 parent bf6b3bc commit 3217c57
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 13 deletions.
33 changes: 22 additions & 11 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,34 @@
on:
release:
types: [published]
types: [published, prereleased]
# Use prereleased for testing, will remove later.

name: Release
jobs:
pypi:
pypi-publish:
name: PyPI Release
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
- name: Remove docs before release
run: rm -rf docs/
- name: PyPI Upload
uses: FeatureLabs/gh-action-pypi-upload@v2
env:
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
TEST_PYPI_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }}
TEST_PYPI_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
- uses: actions/setup-python@4
- name: Install deps
run: |
python -m pip install --quiet --upgrade pip
python -m pip install --quiet --upgrade build
python -m pip install --quiet --upgrade setuptools
- name: Remove build artifacts and docs
run: |
rm -rf .eggs/ dist/ build/ docs/
- name: Build distribution
run: python -m build

# Trying to publish to TestPyPI first - will update when this works
- name: Publish package distributions to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
- name: Run workflow to create feedstock pull request
run: |
gh workflow run create_feedstock_pr.yaml --repo "alteryx/featuretools" -f version=${{ github.event.release.tag_name }}
Expand Down
6 changes: 4 additions & 2 deletions docs/source/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ Future Release
* Changes
* Documentation Changes
* Testing Changes
* Update tests for compatibility with new versions of ``holidays`` (:pr:`2636`)
* Update ruff to 0.1.6 and use ruff linter/formatter (:pr:`2639`)
* Update tests for compatibility with new versions of ``holidays`` (:pr:`2636`)
* Update ruff to 0.1.6 and use ruff linter/formatter (:pr:`2639`)
* Update ``release.yaml`` to use trusted publisher for PyPI releases (:pr:`2646`)


Thanks to the following people for contributing to this release:
:user:`gsheni`, :user:`thehomebrewnerd`, :user:`tamargrey`
Expand Down

0 comments on commit 3217c57

Please sign in to comment.