-
-
Notifications
You must be signed in to change notification settings - Fork 38
48 lines (44 loc) · 1.24 KB
/
publish.yml
File metadata and controls
48 lines (44 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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
- name: Install built wheel
run: pip install dist/*
- name: Build package
run: python -m build
- name: Echo current tag
run: echo ${{ github.ref }}
- name: Get package version
run: |
PACKAGE_VERSION=$(python -c 'import matplotlib_inline; print(matplotlib_inline.__version__)')
echo "Package version: $PACKAGE_VERSION"
- name: Check tag and package version match
run: |
if [ "$GITHUB_REF" != "refs/tags/$PACKAGE_VERSION" ]; then
echo "Tag and package version do not match. Aborting."
exit 1
fi
# - name: Publish package
# uses: pypa/gh-action-pypi-publish@15c56dba361d8335944d31a2ecd17d700fc7bcbc