forked from Learnosity/learnosity-sdk-python
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (37 loc) · 1.09 KB
/
dispatch-release-pypi.yml
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
# This workflow will release to PyPi
name: Release to PyPi
on:
release:
types: [published]
workflow_dispatch:
permissions:
contents: read
jobs:
publish_pypi:
name: upload release to PyPI
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- name: Check out code
uses: actions/checkout@v4
# grep exits with a non-zero exit code if a match is not found
- name: Check Library Version matches ${{ github.ref_name }}
id: check_version
run: |
grep "${{ github.ref_name }}" learnosity_sdk/_version.py
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and check Python distributions
run: |
python setup.py sdist bdist_wheel
twine check dist/*
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1