-
Notifications
You must be signed in to change notification settings - Fork 15
46 lines (36 loc) · 1.2 KB
/
publish-python-package.yml
File metadata and controls
46 lines (36 loc) · 1.2 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
name: Publish Python Package
on:
push:
tags:
- 'v*'
jobs:
publish-package:
name: Publish Package
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set tag version
id: tag_version
run: |
tag=$(echo $GITHUB_REF | cut -d / -f 3)
echo ::set-output name=version::${tag:1}
- name: Install dependencies
run: python3 -m pip install --upgrade build twine
- name: Build project
run: python3 -m build
- name: Check build
run: python3 -m twine check dist/*
- name: Install leetcode-export
run: sudo python3 setup.py install
- name: Check that tag version matched Python package version
run: |
expected="leetcode-export ${{ steps.tag_version.outputs.version }}"
actual=$(leetcode-export --version)
echo expected=\"$expected\"
echo actual=\"$actual\"
[[ $expected == $actual ]]
- name: Remove deprecated egg file
run: rm -f dist/*.egg
- name: Publish project
run: python3 -m twine upload dist/* -u ${{ secrets.PYPY_USERNAME }} -p ${{ secrets.PYPY_PASSWORD }} --non-interactive