name: "Publish Wheel" on: push: tags: - '*' permissions: contents: read jobs: pypi-publish: name: Upload release to PyPI runs-on: ubuntu-latest environment: name: pypi url: https://pypi.org/project/matplotlib-inline permissions: id-token: write steps: - uses: actions/checkout@v5 - name: Set up Python uses: actions/setup-python@v6 with: python-version: '3.x' - name: Install dependencies run: | python -m pip install --upgrade pip pip install build matplotlib IPython - name: Build package run: python -m build - name: Install built wheel run: pip install dist/*.whl - name: Echo current tag run: echo ${{ github.ref }} - name: Get package version run: | export PACKAGE_VERSION=$(python -c 'import matplotlib_inline; print(matplotlib_inline.__version__)') echo "Package version: $PACKAGE_VERSION" if [ "$GITHUB_REF" != "refs/tags/$PACKAGE_VERSION" ]; then echo "Tag and package version do not match. Aborting. $GITHUB_REF vs refs/tags/$PACKAGE_VERSION" exit 1 fi - name: Publish package uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e