-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (43 loc) · 1.83 KB
/
upload-to-pip.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
47
48
49
50
51
52
53
54
55
name: Upload to PIP
on:
release:
types: [created]
# Allows for manual triggering
workflow_dispatch:
jobs:
upload:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4 # without submodules
- name: Disable the keychain credential helper
run: git config --global credential.helper ""
- name: Enable the local store credential helper
run: git config --global --add credential.helper store
- name: Add credential
run: echo "https://x-access-token:${{ secrets.SUBMODULE_GITHUB_TOKEN }}@github.com" >> ~/.git-credentials
- name: Tell git to use https instead of ssh whenever it encounters it
run: 'git config --global url."https://github.com/".insteadof [email protected]:'
- name: Git submodule initialization
run: |
git submodule update --init --recursive
- name: Set up Python
uses: actions/setup-python@v4
with:
# Semantic version range syntax or exact version of a Python version
python-version: "3.9"
# Optional - x64 or x86 architecture, defaults to x64
architecture: "x64"
- name: "Installs dependencies"
run: |
python3 -m pip install --upgrade pip
python3 -m pip install setuptools wheel twine
- name: "List directory"
run: |
ls -al
- name: "Builds and uploads to PyPI"
run: |
python3 setup.py sdist bdist_wheel
python3 -m twine upload --verbose dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TWINE_TOKEN }}