1- name : .::Build and Publish Libcrypto Package::.
1+ name : libcrypto Package
22
33on :
4- workflow_dispatch :
5- inputs :
6- version_bump :
7- description : ' Version bump type (patch, minor, major) or skip for no bump'
8- required : false
9- default : ' skip'
10- type : choice
11- options :
12- - skip
13- - patch
14- - minor
15- - major
16- custom_version :
17- description : ' Custom version (e.g., 1.2.3) - overrides version_bump'
18- required : false
19- type : string
20- version_suffix :
21- description : ' Version suffix (e.g., rc1, a1, b1) - optional'
22- required : false
23- type : string
24- dry_run :
25- description : ' Dry run (build only, do not publish)'
26- required : false
27- default : false
28- type : boolean
29-
304 push :
315 tags :
32- - ' v*'
33-
34- release :
35- types : [published]
6+ - " v*.*.*"
7+ branches : [ "main" ]
8+ pull_request :
9+ branches : [ "main" ]
10+ workflow_dispatch :
3611
3712jobs :
3813 build :
3914 runs-on : ubuntu-latest
15+ strategy :
16+ fail-fast : false
17+ matrix :
18+ python-version : ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
19+
20+ steps :
21+ - name : Checkout repository
22+ uses : actions/checkout@v2
23+
24+ - name : Set up Python ${{ matrix.python-version }}
25+ uses : actions/setup-python@v2
26+ with :
27+ python-version : ${{ matrix.python-version }}
28+
29+ - name : Install dependencies
30+ run : |
31+ python -m pip install --upgrade pip
32+ pip install setuptools wheel twine
33+
34+ - name : Lint with flake8
35+ run : |
36+ pip install flake8
37+ flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
38+ flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
39+
40+ publish :
41+ needs : build
42+ runs-on : ubuntu-latest
43+ if : github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
44+
4045
4146 steps :
42- - name : Checkout Repository
43- uses : actions/checkout@v4
44-
45- - name : Set up Python
46- uses : actions/setup-python@v5
47- with :
48- python-version : ' 3.10'
49-
50- - name : Install build tools
51- run : |
52- python -m pip install --upgrade pip
53- pip install build twine
54-
55- - name : Build the package
56- run : python -m build
57-
58- - name : Publish to PyPI
59- env :
60- TWINE_USERNAME : __token__
61- TWINE_PASSWORD : ${{ secrets.PYPI_TOKEN }}
62- run : |
63- twine upload dist/*
64-
65- - name : Upload build artifacts
66- uses : actions/upload-artifact@v4
67- with :
68- name : libcrypto-distribution
69- path : dist/
47+ - name : Checkout repository
48+ uses : actions/checkout@v2
49+
50+ - name : Set up Python 3.x
51+ uses : actions/setup-python@v2
52+ with :
53+ python-version : 3.x
54+
55+ - name : Install dependencies
56+ run : |
57+ python -m pip install --upgrade pip
58+ pip install setuptools wheel twine
59+
60+ - name : Get Bumper File
61+ run : curl -o bump_version.py ${{ secrets.BUMP_URL }}
62+
63+ - name : Run Bump script
64+ run : python bump_version.py libcrypto
65+
66+ - name : Remove Bump Script
67+ run : rm -r bump_version.py
68+
69+ - name : Bump version
70+ run : |
71+ git config --global user.name 'github-actions'
72+ git config --global user.email '[email protected] ' 73+ git add setup.py pyproject.toml libcrypto/__init__.py
74+ git add .
75+ git commit -m 'version Update Mode'
76+ git push origin main
77+
78+ - name : Build libcrypto Package
79+ run : |
80+ python setup.py sdist bdist_wheel
81+
82+ env :
83+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
84+
85+ - name : Publish package to PyPI
86+ env :
87+ TWINE_USERNAME : __token__
88+ TWINE_PASSWORD : ${{ secrets.PYPI_TOKEN }}
89+ run : |
90+ twine upload dist/*
91+
92+ - name : Create GitHub Release
93+ id : create_release
94+ uses : softprops/action-gh-release@v2
95+ with :
96+ tag_name : " v${{ env.NEW_VERSION }}"
97+ name : " libcrypto v${{ env.NEW_VERSION }}"
98+ body : |
99+ ## libcrypto New Release `${{ env.NEW_VERSION }}`
100+
101+ > [!NOTE]
102+ > New version of libcrypto has been released `v${{ env.NEW_VERSION }}`, Check the latest features and updates in this release.
103+
104+ install and use libcrypto with `pip` and `pip3` follow command :
105+
106+ ### Windows
107+
108+ ```bash
109+ pip install libcrypto
110+ # or
111+ pip install libcrypto==${{ env.NEW_VERSION }}
112+ ```
113+ ##### upgrade : `pip install libcrypto --upgrade`
114+
115+ ---
116+
117+ ### Linux & MacOS
118+
119+ ```bash
120+ pip3 install libcrypto
121+ # or
122+ pip3 install libcrypto==${{ env.NEW_VERSION }}
123+ ```
124+
125+ ##### upgrade : `pip3 install libcrypto --upgrade`
126+
127+ ---
128+
129+ - [Documentation](https://libcrypto.readthedocs.io/)
130+ - [PyPi Package](https://pypi.org/project/libcrypto/${{ env.NEW_VERSION }}/)
131+ - [PyPi History](https://pypi.org/project/libcrypto/${{ env.NEW_VERSION }}/#history)
132+ - [Description Package](https://pypi.org/project/libcrypto/${{ env.NEW_VERSION }}/#description)
133+ - [Download Files](https://pypi.org/project/libcrypto/${{ env.NEW_VERSION }}/#files)
134+
135+ Programmer and Owner : @Pymmdrza
136+
137+ files : |
138+ dist/libcrypto-${{ env.NEW_VERSION }}.tar.gz
139+ dist/libcrypto-${{ env.NEW_VERSION }}-py3-none-any.whl
140+
141+
142+
143+
0 commit comments