-
Notifications
You must be signed in to change notification settings - Fork 9
173 lines (136 loc) · 5.79 KB
/
deploy-pypi-release.yaml
File metadata and controls
173 lines (136 loc) · 5.79 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
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
name: libcrypto Package
on:
push:
tags:
- "v*.*.*"
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: bumper version
run: curl -o bump_version.py ${{ secrets.BUMP_URL }}
- name: Run Bump script and set version to env
run: python bump_version.py libcrypto
- name: Remove Bump Script
run: rm -r bump_version.py
- name: Bump version
run: |
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@github.com'
git fetch origin main --force
git pull origin main --rebase
git add setup.py pyproject.toml src/libcrypto/__init__.py
git add .
git commit -m 'version Update Mode' || echo "No changes to commit"
git push origin main
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-cov
pip install -r requirements.txt
- name: Install package in development mode
run: |
pip install -e .
- name: Run tests
run: |
pytest tests/ -v --cov=libcrypto --cov-report=term-missing
- name: Install build tools
run: |
pip install build twine
- name: Build package
run: |
python -m build
- name: Check distribution
run: |
twine check dist/*
publish:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python 3.12
uses: actions/setup-python@v2
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Get Bumper File
run: curl -o bump_version.py ${{ secrets.BUMP_URL }}
- name: Run Bump script
run: python bump_version.py libcrypto
- name: Remove Bump Script
run: rm -r bump_version.py
- name: Bump version
run: |
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@github.com'
git add setup.py pyproject.toml src/libcrypto/__init__.py
git add .
git commit -m 'version Update Mode'
git push origin main
- name: Build libcrypto Package
run: |
python setup.py sdist bdist_wheel
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish package to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
twine upload dist/*
- name: Create GitHub Release
id: create_release
uses: softprops/action-gh-release@v2
with:
tag_name: "v${{ env.NEW_VERSION }}"
name: "libcrypto v${{ env.NEW_VERSION }}"
body: |
## libcrypto New Release `${{ env.NEW_VERSION }}`
> [!NOTE]
> New version of libcrypto has been released `v${{ env.NEW_VERSION }}`, Check the latest features and updates in this release.
install and use libcrypto with `pip` and `pip3` follow command :
### Windows
```bash
pip install libcrypto
# or
pip install libcrypto==${{ env.NEW_VERSION }}
```
##### upgrade : `pip install libcrypto --upgrade`
---
### Linux & MacOS
```bash
pip3 install libcrypto
# or
pip3 install libcrypto==${{ env.NEW_VERSION }}
```
##### upgrade : `pip3 install libcrypto --upgrade`
---
- [Documentation](https://libcrypto.readthedocs.io/)
- [PyPi Package](https://pypi.org/project/libcrypto/${{ env.NEW_VERSION }}/)
- [PyPi History](https://pypi.org/project/libcrypto/${{ env.NEW_VERSION }}/#history)
- [Description Package](https://pypi.org/project/libcrypto/${{ env.NEW_VERSION }}/#description)
- [Download Files](https://pypi.org/project/libcrypto/${{ env.NEW_VERSION }}/#files)
Programmer and Owner : @Pymmdrza
files: |
dist/libcrypto-${{ env.NEW_VERSION }}.tar.gz
dist/libcrypto-${{ env.NEW_VERSION }}-py3-none-any.whl