Skip to content

Commit 4254095

Browse files
⬆️ CI/CD: Updated
1 parent a399134 commit 4254095

File tree

2 files changed

+94
-48
lines changed

2 files changed

+94
-48
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- 'release/**'
7+
8+
permissions:
9+
contents: write
10+
11+
env:
12+
TAG: ${{ github.ref_name }}
13+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14+
15+
jobs:
16+
deployment:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v3
21+
with:
22+
repo-token: ${{ secrets.GITHUB_TOKEN }}
23+
24+
- name: 📑 Create tag
25+
run: |
26+
echo "test"
27+
echo VARIAVEL_ABC="$(git ls-remote --tags origin | grep ${TAG##*/})" >> $GITHUB_ENV
28+
29+
if [[ -n "$VARIAVEL_ABC" ]]; then
30+
echo NEW_TAG="${TAG##*/}-rc-`expr "${VARIAVEL_ABC:0-1}" + 1`" >> $GITHUB_ENV
31+
else
32+
echo NEW_TAG="${TAG##*/}-rc-1" >> $GITHUB_ENV
33+
fi
34+
35+
git tag $NEW_TAG
36+
git push origin --tags
37+
38+
echo tag $TAG
39+
echo output $VARIAVEL_ABC
40+
echo new_tag $NEW_TAG
41+
shell: bash
42+
43+
- name: ⚙️ Set up Python 3.11
44+
uses: actions/setup-python@v3
45+
with:
46+
python-version: "3.11"
47+
48+
# - name: ⚙️ Install dependencies
49+
# run: |
50+
# python -m pip install --upgrade pip
51+
# pip install tomli-w --no-cache-dir
52+
53+
# - name: ✅ Update version
54+
# env:
55+
# NEW_TAG: ${{ env.NEW_TAG }}
56+
# run: |
57+
# python ./.github/python-library-rc.py
58+
59+
# - name: 📝 Git Config
60+
# run: |
61+
# git config --global user.email [email protected]
62+
# git config --global user.name 🐧
63+
# shell: bash
64+
65+
# - name: 📝 Git Process
66+
# run: |
67+
# if [[ `git status --porcelain` ]]; then
68+
# git add --all
69+
# git commit -a -m "Updated Version"
70+
# git push origin HEAD:$TAG --force
71+
# else
72+
# echo "WARNING: No changes were detected. git commit push action aborted."
73+
# fi
74+
# shell: bash
75+
# continue-on-error: true
76+
77+
# - name: 🚀 Create release
78+
# run: |
79+
# gh release create $NEW_TAG \
80+
# --repo="$GITHUB_REPOSITORY" \
81+
# --title="$NEW_TAG" \
82+
# --generate-notes

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

Lines changed: 12 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,20 @@ permissions:
1010

1111
env:
1212
TAG: ${{ github.ref_name }}
13-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1413

1514
jobs:
1615
deployment:
1716
runs-on: ubuntu-latest
1817

1918
steps:
2019
- uses: actions/checkout@v3
21-
with:
22-
repo-token: ${{ secrets.GITHUB_TOKEN }}
2320

2421
- name: 📑 Create tag
2522
run: |
26-
echo "test"
27-
echo VARIAVEL_ABC="$(git ls-remote --tags origin | grep ${TAG##*/})" >> $GITHUB_ENV
23+
echo OUTPUT="$(git ls-remote --tags origin | grep ${TAG##*/})" >> $GITHUB_ENV
2824
29-
if [[ -n "$VARIAVEL_ABC" ]]; then
30-
echo NEW_TAG="${TAG##*/}-rc-`expr "${VARIAVEL_ABC:0-1}" + 1`" >> $GITHUB_ENV
25+
if [[ -n "$OUTPUT" ]]; then
26+
echo NEW_TAG="${TAG##*/}-rc-`expr "${OUTPUT:0-1}" + 1`" >> $GITHUB_ENV
3127
else
3228
echo NEW_TAG="${TAG##*/}-rc-1" >> $GITHUB_ENV
3329
fi
@@ -36,47 +32,15 @@ jobs:
3632
git push origin --tags
3733
3834
echo tag $TAG
39-
echo output $VARIAVEL_ABC
35+
echo output $OUTPUT
4036
echo new_tag $NEW_TAG
4137
shell: bash
4238

43-
- name: ⚙️ Set up Python 3.11
44-
uses: actions/setup-python@v3
45-
with:
46-
python-version: "3.11"
47-
48-
# - name: ⚙️ Install dependencies
49-
# run: |
50-
# python -m pip install --upgrade pip
51-
# pip install tomli-w --no-cache-dir
52-
53-
# - name: ✅ Update version
54-
# env:
55-
# NEW_TAG: ${{ env.NEW_TAG }}
56-
# run: |
57-
# python ./.github/python-library-rc.py
58-
59-
# - name: 📝 Git Config
60-
# run: |
61-
# git config --global user.email [email protected]
62-
# git config --global user.name 🐧
63-
# shell: bash
64-
65-
# - name: 📝 Git Process
66-
# run: |
67-
# if [[ `git status --porcelain` ]]; then
68-
# git add --all
69-
# git commit -a -m "Updated Version"
70-
# git push origin HEAD:$TAG --force
71-
# else
72-
# echo "WARNING: No changes were detected. git commit push action aborted."
73-
# fi
74-
# shell: bash
75-
# continue-on-error: true
76-
77-
# - name: 🚀 Create release
78-
# run: |
79-
# gh release create $NEW_TAG \
80-
# --repo="$GITHUB_REPOSITORY" \
81-
# --title="$NEW_TAG" \
82-
# --generate-notes
39+
- name: 🚀 Create release
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
run: |
43+
gh release create $NEW_TAG \
44+
--repo="$GITHUB_REPOSITORY" \
45+
--title="$NEW_TAG" \
46+
--generate-notes

0 commit comments

Comments
 (0)