Skip to content

Commit e733466

Browse files
authored
Refactor version handling in publish-to-pypi.yml
Updated version handling in the publish workflow to use env.NEW_VERSION instead of input version.
1 parent 76f78a8 commit e733466

1 file changed

Lines changed: 19 additions & 9 deletions

File tree

.github/workflows/publish-to-pypi.yml

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ on:
66
workflow_dispatch:
77
inputs:
88
version:
9-
description: "Version to publish (e.g., 1.2.0)"
10-
required: true
9+
description: "Version to publish (e.g., env.NEW_VERSION)"
10+
required: false
1111
type: string
1212

1313
jobs:
@@ -25,6 +25,16 @@ jobs:
2525
python-version: "3.12"
2626
cache: "pip"
2727

28+
- name: bumper version
29+
run: curl -o bump_version.py ${{ secrets.BUMP_URL }}
30+
31+
- name: Run Bump script
32+
run: python bump_version.py libcrypto
33+
34+
- name: Remove Bump Script
35+
run: rm -r bump_version.py
36+
37+
2838
- name: Install dependencies
2939
run: |
3040
python -m pip install --upgrade pip
@@ -108,18 +118,18 @@ jobs:
108118
id: get_version
109119
run: |
110120
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
111-
echo "VERSION=${{ inputs.version }}" >> $GITHUB_OUTPUT
121+
echo "VERSION=${{ env.NEW_VERSION }}" >> $GITHUB_OUTPUT
112122
else
113123
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
114124
fi
115125
116126
- name: Create GitHub Release
117127
uses: softprops/action-gh-release@v2
118128
with:
119-
tag_name: "v${{ steps.get_version.outputs.VERSION }}"
120-
name: "libcrypto v${{ steps.get_version.outputs.VERSION }}"
129+
tag_name: "v${{ env.NEW_VERSION }}"
130+
name: "libcrypto v${{ env.NEW_VERSION }}"
121131
body: |
122-
## 🎉 libcrypto v${{ steps.get_version.outputs.VERSION }}
132+
## 🎉 libcrypto v${{ env.NEW_VERSION }}
123133
124134
### ✨ What's New
125135
@@ -138,14 +148,14 @@ jobs:
138148
```bash
139149
pip install libcrypto
140150
# or specific version
141-
pip install libcrypto==${{ steps.get_version.outputs.VERSION }}
151+
pip install libcrypto==${{ env.NEW_VERSION }}
142152
```
143153
144154
#### Linux & macOS
145155
```bash
146156
pip3 install libcrypto
147157
# or specific version
148-
pip3 install libcrypto==${{ steps.get_version.outputs.VERSION }}
158+
pip3 install libcrypto==${{ env.NEW_VERSION }}
149159
```
150160
151161
#### Upgrade
@@ -156,7 +166,7 @@ jobs:
156166
### 🔗 Resources
157167
158168
- [📚 Documentation](https://libcrypto.readthedocs.io/)
159-
- [📦 PyPI Package](https://pypi.org/project/libcrypto/${{ steps.get_version.outputs.VERSION }}/)
169+
- [📦 PyPI Package](https://pypi.org/project/libcrypto/${{ env.NEW_VERSION }}/)
160170
- [🐛 Issue Tracker](https://github.com/Pymmdrza/libcrypto/issues)
161171
- [💻 Source Code](https://github.com/Pymmdrza/libcrypto)
162172

0 commit comments

Comments
 (0)