chore(deps): bump actions/github-script from 6 to 7 (#34) #37
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release and Publish | |
on: | |
push: | |
branches: [ main ] | |
tags: [ 'v[0-9]+.[0-9]+.[0-9]+' ] | |
permissions: | |
contents: write | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
if: ${{ github.repository == 'substrait-io/substrait-python' }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.x" | |
- name: Install build dependencies | |
run: | | |
python -m pip install build --user | |
- name: Build package | |
run: | | |
python -m build | |
- name: Upload package | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: dist/ | |
retention-days: 1 | |
release: | |
name: Release to GitHub | |
runs-on: ubuntu-latest | |
needs: build | |
if: startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: dist | |
path: dist/ | |
- name: Publish to GitHub release page | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
./dist/*.whl | |
./dist/*.tar.gz | |
publish: | |
name: Publish to PyPI | |
runs-on: ubuntu-latest | |
needs: release | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: dist | |
path: dist/ | |
- name: Publish package to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} |