File tree Expand file tree Collapse file tree 3 files changed +19
-52
lines changed Expand file tree Collapse file tree 3 files changed +19
-52
lines changed Original file line number Diff line number Diff line change 11name : CD Workflow
22
3- on :
3+ on :
44 push :
5- tags :
6- - " services/[a-zA-Z]+/v[0-9]+.[0-9]+.[0-9]+*"
7- - " core/v[0-9]+.[0-9]+.[0-9]+*"
8- workflow_dispatch :
5+ branches :
6+ - main
97
108jobs :
11- main :
12- name : Build & Publish module
13- runs-on : " ubuntu-latest "
14- steps :
15- - name : Checkout
16- uses : actions/checkout@v4
9+ check-version :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - uses : actions/checkout@v4
13+ with :
14+ fetch-depth : 0
1715 - name : Install Python
1816 uses : actions/setup-python@v5
1917 with :
20- python-version : " 3.8"
21- - name : Extract updated module path
18+ python-version : " 3.8"
19+ - name : Push tag for each updated package
2220 env :
23- TAG : ${{ github.event.ref }}
24- run : |
25- # Remove the `refs/tags` prefix of the git tag
26- TAG_NO_PREFIX=$(echo "$TAG" | sed 's/^refs\/tags\///')
27- # Extract the path of the module to publish from the tag
28- PACKAGE_PATH=$(echo "$TAG_NO_PREFIX" | rev | cut -d'/' -f2- | rev)
29- # Save the path to the module for use in the build/publish step to only update the module associated with this tag
30- echo "PACKAGE_PATH=$PACKAGE_PATH" >> $GITHUB_ENV
31- - name : Build & Publish to PyPi
21+ GH_TOKEN : ${{ secrets.RENOVATE_TOKEN }}
3222 run : |
23+ git config --global user.name "SDK Releaser Bot"
24+ git config --global user.email "[email protected] " 25+
3326 pip install poetry
34- cd $PACKAGE_PATH
35- poetry publish --build --username="__token__" --no-interaction --password="${{ secrets.PYPI_TOKEN }}"
27+ scripts/cd.sh
28+
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -10,8 +10,10 @@ for file in $(git diff --name-only HEAD~1..HEAD | grep pyproject.toml); do
1010 if git rev-parse --verify $expected_tag ^{tag} & > /dev/null; then
1111 echo " Tag '$expected_tag ' already exists."
1212 else
13+ # Tag doesn't exist. Create tag and build/publish to PyPi
1314 echo " Tag '$expected_tag ' does not exist. Creating new tag to trigger release."
1415 git tag -a $expected_tag -m " Release $version "
1516 git push origin tag $expected_tag
17+ poetry publish --build --username=" __token__" --no-interaction --password=" ${{ secrets.PYPI_TOKEN } }"
1618 fi
1719done
You can’t perform that action at this time.
0 commit comments