X Tutup
Skip to content

Commit ba34ec4

Browse files
committed
feat: major update
1 parent 30828e1 commit ba34ec4

File tree

2 files changed

+7
-53
lines changed

2 files changed

+7
-53
lines changed

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

Lines changed: 6 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ jobs:
2020
- uses: actions/checkout@v4
2121
with:
2222
fetch-depth: 0
23-
token: ${{ secrets.GITHUB_TOKEN }}
2423

2524
- name: Set up Python
2625
uses: actions/setup-python@v5
@@ -33,66 +32,21 @@ jobs:
3332
pip install build twine python-semantic-release
3433
pip install -r utils/requirements.txt
3534
36-
- name: Configure Git
37-
run: |
38-
git config user.name "github-actions[bot]"
39-
git config user.email "github-actions[bot]@users.noreply.github.com"
40-
41-
- name: Run semantic release
35+
- name: Create stable release
4236
id: release
4337
env:
4438
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4539
run: |
46-
set +e
47-
python -m semantic_release version --no-push
48-
RELEASE_EXIT_CODE=$?
49-
set -e
50-
51-
if [ $RELEASE_EXIT_CODE -eq 0 ]; then
52-
echo "version_created=true" >> $GITHUB_OUTPUT
53-
# Get the new version
54-
NEW_VERSION=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')
55-
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
56-
echo "New version: $NEW_VERSION"
57-
58-
# Push changes
59-
git push origin release --tags
60-
else
61-
echo "version_created=false" >> $GITHUB_OUTPUT
62-
echo "No new version created (exit code: $RELEASE_EXIT_CODE)"
63-
fi
40+
semantic-release version --commit --tag --push
41+
echo "released=$?" >> $GITHUB_OUTPUT
6442
6543
- name: Build package
66-
if: steps.release.outputs.version_created == 'true'
44+
if: steps.release.outputs.released == '0'
6745
run: bash utils/build_package.sh
6846

69-
- name: Check distribution files
70-
if: steps.release.outputs.version_created == 'true'
71-
run: |
72-
ls -lah dist/
73-
echo "Files to be uploaded:"
74-
find dist/ -type f
75-
7647
- name: Publish to PyPI
77-
if: steps.release.outputs.version_created == 'true'
48+
if: steps.release.outputs.released == '0'
7849
uses: pypa/gh-action-pypi-publish@release/v1
7950
with:
8051
packages-dir: dist/
81-
skip-existing: true
82-
verbose: true
83-
84-
- name: Summary
85-
if: steps.release.outputs.version_created == 'true'
86-
run: |
87-
echo "## 🚀 Release Published" >> $GITHUB_STEP_SUMMARY
88-
echo "Version: ${{ steps.release.outputs.new_version }}" >> $GITHUB_STEP_SUMMARY
89-
echo "Package: https://pypi.org/project/universalpython/${{ steps.release.outputs.new_version }}/" >> $GITHUB_STEP_SUMMARY
90-
91-
- name: No release needed
92-
if: steps.release.outputs.version_created != 'true'
93-
run: |
94-
echo "## ℹ️ No Release Created" >> $GITHUB_STEP_SUMMARY
95-
echo "No new version was created. Make sure you have commits following conventional commit format:" >> $GITHUB_STEP_SUMMARY
96-
echo "- \`feat:\` for new features (minor version bump)" >> $GITHUB_STEP_SUMMARY
97-
echo "- \`fix:\` for bug fixes (patch version bump)" >> $GITHUB_STEP_SUMMARY
98-
echo "- \`BREAKING CHANGE:\` in commit body for major version bump" >> $GITHUB_STEP_SUMMARY
52+
skip-existing: true

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "universalpython"
7-
version = "0.1.0"
7+
version = "0.1.9b7"
88
authors = [
99
{name = "Saad Bazaz", email = "saadbazaz@hotmail.com"},
1010
]

0 commit comments

Comments
 (0)
X Tutup