forked from pytgcalls/pytgcalls
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (79 loc) · 2.35 KB
/
build-and-publish-wheels.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# This is the workflow to make and push wheels to PyPi
name: Build Wheels
on:
push:
branches: [ kaizoku ]
paths-ignore:
- '.gitignore'
- '.npmignore'
- '.pre-commit-config.yaml'
- 'CODE_OF_CONDUCT.md'
- 'CONTRIBUTING.md'
- 'LICENSE'
- 'README.md'
- 'install_nodejs.sh'
- 'example/*'
- '.github/*'
workflow_dispatch:
jobs:
pytgwin-build:
runs-on: windows-latest
strategy:
matrix:
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11' ]
steps:
- name: Get Branch Name
run: echo "::set-output name=branch::${GITHUB_REF#refs/heads/}"
id: github_info
- name: Checkout ${{ steps.github_info.outputs.branch }}
uses: actions/checkout@v2
with:
ref: ${{ steps.github_info.outputs.branch }}
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Setup Python${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install pip requirements
run: |
python -m pip install wheel setuptools
- name: Build wheel for Python${{ matrix.python-version }}
run: |
python setup.py sdist bdist_wheel
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: pytgcalls-python${{ matrix.python-version }}
path:
dist/*.whl
build-n-publish:
name: Build and publish to PyPI
runs-on: windows-latest
needs: [pytgwin-build]
steps:
- name: Install Python3.11
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Install pip requirements
run: |
python -m pip install twine
- name: Download artifacts
uses: actions/download-artifact@v2
with:
path: tmp/
- name: Extract artifacts
run: |
md dist
Get-ChildItem -Path .\tmp -Recurse -File | Move-Item -Destination .\dist
- name: Push to PyPi
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: |
echo "${{ github.ref }} ${{ github.workspace }}"
python -m twine check dist/*
python -m twine upload dist/*