Skip to content

v1.2.0 Hide the legends! #15

v1.2.0 Hide the legends!

v1.2.0 Hide the legends! #15

Workflow file for this run

name: Upload Python Package
on:
release:
types: [published]
permissions:
contents: read
jobs:
release-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: "3.x"
- name: Ensure tag is v-prefixed
id: check_tag
run: |
if [[ "${{ github.ref }}" != refs/tags/v* ]]; then
echo "Error: Release tag must be v-prefixed (e.g., v1.0.0)."
exit 1
fi
- name: Extract version from release tag
id: get_version
run: |
echo "Release tag: ${{ github.event.release.tag_name }}"
VERSION="${{ github.event.release.tag_name }}"
VERSION="${VERSION#v}"
echo "Version: $VERSION"
echo "release_version=$VERSION" >> $GITHUB_ENV
- name: Install Poetry
run: pipx install poetry==1.8.4
- name: Update version in pyproject.toml
run: |
poetry version ${{ env.release_version }}
- name: Build release distributions
run: |
poetry build
- name: Upload distributions
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: release-dists
path: dist/
pypi-publish:
runs-on: ubuntu-latest
needs:
- release-build
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
# Dedicated environments with protections for publishing are strongly recommended.
environment:
name: pypi
# OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
url: https://pypi.org/project/graphedexcel/
steps:
- name: Retrieve release distributions
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: release-dists
path: dist/
- name: Publish release distributions to PyPI
uses: pypa/gh-action-pypi-publish@15c56dba361d8335944d31a2ecd17d700fc7bcbc # release/v1