Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: update release publisher workflow from starbase #35

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions .github/workflows/release-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,20 @@ permissions:

jobs:
source-wheel:
runs-on: ubuntu-latest
runs-on: [self-hosted, jammy]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Fetch tag annotations
run: |
# Note: we fetch the tags here instead of using actions/checkout's "fetch-tags"
# because of https://github.com/actions/checkout/issues/1467
git fetch --force --tags --depth 1
git describe --dirty --long --match '[0-9]*.[0-9]*.[0-9]*' --exclude '*[^0-9.]*'
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.10"
check-latest: true
- name: Build packages
run: |
Expand All @@ -36,25 +38,33 @@ jobs:
path: dist/
pypi:
needs: ["source-wheel"]
runs-on: ubuntu-latest
runs-on: [self-hosted, jammy]
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- name: Get packages
uses: actions/download-artifact@v4
with:
name: pypi-packages
path: dist/
- name: Publish to pypi
# Note: this action uses PyPI's support for Trusted Publishers
# It needs a configuration on the PyPI project - see:
# https://docs.pypi.org/trusted-publishers/adding-a-publisher/#github-actions
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
github-release:
needs: ["source-wheel"]
runs-on: ubuntu-latest
runs-on: [self-hosted, jammy]
steps:
- name: Get pypi artifacts
uses: actions/download-artifact@v4
with:
name: pypi-packages
- name: Release
uses: softprops/action-gh-release@v2
with:
# Add wheel and source tarball
files: |
**
*.whl
*.tar.gz
Loading