Skip to content

Commit 871ecf7

Browse files
⬆️ CI/CD: Updated
1 parent e30ca7b commit 871ecf7

File tree

2 files changed

+36
-13
lines changed

2 files changed

+36
-13
lines changed

.github/python-library-rc.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1+
import os
12
import tomllib
23
import tomli_w
34

45

6+
NEW_TAG = os.getenv("NEW_TAG")
7+
8+
59
with open("pyproject.toml", "rb") as f:
610
data = tomllib.load(f)
7-
data["tool"]["poetry"]["version"] = "0.3.0"
11+
data["tool"]["poetry"]["version"] = NEW_TAG
812

913

1014
with open("pyproject.toml", "wb") as f:

.github/workflows/python-library-rc.yml

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ permissions:
1010

1111
env:
1212
TAG: ${{ github.ref_name }}
13+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1314

1415
jobs:
1516
deployment:
@@ -20,19 +21,19 @@ jobs:
2021
with:
2122
repo-token: ${{ secrets.GITHUB_TOKEN }}
2223

23-
- name: 📑 Create tag
24-
run: |
25-
echo OUTPUT="$(git ls-remote --tags origin | grep ${TAG##*/})" >> $GITHUB_ENV
24+
# - name: 📑 Create tag
25+
# run: |
26+
# echo OUTPUT="$(git ls-remote --tags origin | grep ${TAG##*/})" >> $GITHUB_ENV
2627

27-
if [[ -n "$OUTPUT" ]]; then
28-
echo NEW_TAG="${TAG##*/}-rc-`expr "${OUTPUT:0-1}" + 1`" >> $GITHUB_ENV
29-
else
30-
echo NEW_TAG="${TAG##*/}-rc-1" >> $GITHUB_ENV
31-
fi
28+
# if [[ -n "$OUTPUT" ]]; then
29+
# echo NEW_TAG="${TAG##*/}-rc-`expr "${OUTPUT:0-1}" + 1`" >> $GITHUB_ENV
30+
# else
31+
# echo NEW_TAG="${TAG##*/}-rc-1" >> $GITHUB_ENV
32+
# fi
3233

33-
git tag $NEW_TAG
34-
git push origin --tags
35-
shell: bash
34+
# git tag $NEW_TAG
35+
# git push origin --tags
36+
# shell: bash
3637

3738
- name: ⚙️ Set up Python 3.11
3839
uses: actions/setup-python@v3
@@ -44,12 +45,30 @@ jobs:
4445
python -m pip install --upgrade pip
4546
pip install tomli-w --no-cache-dir
4647
47-
- name: Run Script
48+
- name: Update version
4849
env:
4950
NEW_TAG: ${{ env.NEW_TAG }}
5051
run: |
5152
python ./.github/python-library-rc.py
5253
54+
- name: 📝 Git Config
55+
run: |
56+
git config --global user.email [email protected]
57+
git config --global user.name 🐧
58+
shell: bash
59+
60+
- name: 📝 Git Process
61+
run: |
62+
if [[ `git status --porcelain` ]]; then
63+
git add --all
64+
git commit -a -m "Updated Version"
65+
git push origin HEAD:$TAG --force
66+
else
67+
echo "WARNING: No changes were detected. git commit push action aborted."
68+
fi
69+
shell: bash
70+
continue-on-error: true
71+
5372
- name: 🚀 Create release
5473
run: |
5574
gh release create $NEW_TAG \

0 commit comments

Comments
 (0)