44 push :
55 tags :
66 - " v*.*.*"
7- branches : [ "main" ]
7+ branches : ["main"]
88 pull_request :
9- branches : [ "main" ]
9+ branches : ["main"]
1010 workflow_dispatch :
1111
1212jobs :
@@ -15,129 +15,129 @@ jobs:
1515 strategy :
1616 fail-fast : false
1717 matrix :
18- python-version : ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14" ]
18+ python-version : ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
1919
2020 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
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
3939
4040 publish :
4141 needs : build
4242 runs-on : ubuntu-latest
43- if : github.ref == 'refs/heads/ main' || github.event_name == 'workflow_dispatch'
44-
43+ # Only publish when on main or manually invoked and a PyPI token is available
44+ if : (github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch') && secrets.PYPI_TOKEN != ''
4545
4646 steps :
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 'github-actions@github.com'
73- git add setup.py pyproject.toml src/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-
47+ - name : Checkout repository
48+ uses : actions/checkout@v2
49+
50+ - name : Set up Python 3.12
51+ uses : actions/setup-python@v2
52+ with :
53+ python-version : " 3.12 "
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+ if : ${{ secrets.BUMP_URL != '' }}
62+ run : curl -o bump_version.py ${{ secrets.BUMP_URL }}
63+
64+ - name : Run Bump script
65+ if : ${{ secrets.BUMP_URL != '' }}
66+ run : python bump_version.py libcrypto
67+
68+ - name : Remove Bump Script
69+ if : ${{ secrets.BUMP_URL != '' }}
70+ run : rm -r bump_version.py
71+
72+ - name : Bump version
73+ if : ${{ secrets.BUMP_URL != '' }}
74+ run : |
75+ git config --global user.name 'github-actions '
76+ git config --global user.email 'github-actions@github.com'
77+ git add setup.py pyproject.toml src/libcrypto/__init__.py
78+ git add .
79+ git commit -m 'version Update Mode'
80+ git push origin main
81+
82+ - name : Build libcrypto Package
83+ run : |
84+ python setup.py sdist bdist_wheel
85+
86+ env :
87+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
88+
89+ - name : Publish package to PyPI
90+ env :
91+ TWINE_USERNAME : __token__
92+ TWINE_PASSWORD : ${{ secrets.PYPI_TOKEN }}
93+ run : |
94+ twine upload dist/*
95+
96+ - name : Create GitHub Release
97+ id : create_release
98+ uses : softprops/action-gh-release@v2
99+ with :
100+ tag_name : " v${{ env.NEW_VERSION }} "
101+ name : " libcrypto v${{ env.NEW_VERSION }} "
102+ body : |
103+ ## libcrypto New Release `${{ env.NEW_VERSION }}`
104+
105+ > [!NOTE]
106+ > New version of libcrypto has been released `v${{ env.NEW_VERSION }}`, Check the latest features and updates in this release.
107+
108+ install and use libcrypto with `pip` and `pip3` follow command :
109+
110+ ### Windows
111+
112+ ```bash
113+ pip install libcrypto
114+ # or
115+ pip install libcrypto==${{ env.NEW_VERSION }}
116+ ```
117+ ##### upgrade : `pip install libcrypto --upgrade`
118+
119+ ---
120+
121+ ### Linux & MacOS
122+
123+ ```bash
124+ pip3 install libcrypto
125+ # or
126+ pip3 install libcrypto==${{ env.NEW_VERSION }}
127+ ```
128+
129+ ##### upgrade : `pip3 install libcrypto --upgrade`
130+
131+ ---
132+
133+ - [Documentation ](https://libcrypto.readthedocs.io/ )
134+ - [PyPi Package](https://pypi.org/project/libcrypto/${{ env.NEW_VERSION }}/)
135+ - [PyPi History](https://pypi.org/project/libcrypto/${{ env.NEW_VERSION }}/#history)
136+ - [Description Package](https://pypi.org/project/libcrypto/${{ env.NEW_VERSION }}/#description)
137+ - [Download Files](https://pypi.org/project/libcrypto/${{ env.NEW_VERSION }}/#files)
138+
139+ Programmer and Owner : @Pymmdrza
140+
141+ files : |
142+ dist/libcrypto-${{ env.NEW_VERSION }}.tar.gz
143+ dist/libcrypto-${{ env.NEW_VERSION }}-py3-none-any.whl
0 commit comments