@@ -13,18 +13,17 @@ jobs:
1313 steps :
1414 # Checkout code
1515 - name : Checkout Code
16- # if: github.event.pull_request.merged == true && contains(github.event.commits[0].message, '[skip-ci]') == false
1716 uses : actions/checkout@v2
18- - run : git fetch --prune --unshallow
17+ with :
18+ token : ${{ secrets.ACTION_AUTH_TOKEN }}
19+
1920
2021 # Make sure we have all branches
2122 - name : Fetch other branches
22- # if: github.event.pull_request.merged == true && contains(github.event.commits[0].message, '[skip-ci]') == false
2323 run : git fetch --no-tags --prune --depth=5 origin master
2424
2525 # Setup node
2626 - name : Use Node.js ${{ matrix.node-version }}
27- # if: github.event.pull_request.merged == true && contains(github.event.commits[0].message, '[skip-ci]') == false
2827 uses : actions/setup-node@v3
2928 with :
3029 node-version : ${{ matrix.node-version }}
3433 - uses : c-hive/gha-npm-cache@v1
3534 if : ${{ !env.ACT }}
3635
36+ - name : Set variables
37+ run : |
38+ LATEST_TAG=${{ github.event.release.tag_name }}
39+ echo $LATEST_TAG
40+ arrIN=(${LATEST_TAG//_/ })
41+ echo "LIBRARY=${arrIN[0]}" >> $GITHUB_ENV
42+ echo "VERSION=${arrIN[1]}" >> $GITHUB_ENV
43+ echo $LIBS
44+ echo $VERSION
45+
3746 # Run Install
3847 - name : Install environment
39- # if: github.event.pull_request.merged == true && contains(github.event.commits[0].message, '[skip-ci]') == false
4048 run : npm ci
4149
4250 - name : Run lint
4856 - name : Builds components
4957 run : npm run build --prod --with-deps --base="origin/master"
5058
51- - name : Raise version of tagged libraries
59+ - name : Setup version of tagged libraries
5260 run : |
53- LATEST_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
54- arrIN=(${LATEST_TAG//_/ })
55- LIBRARY=${arrIN[0]}
56- VERSION=${arrIN[1]}
57- echo $LIBS
58- echo $VERSION
5961 if [ -d "$PWD/packages/$LIBRARY" ]; then
6062 cd $PWD/packages/$LIBRARY
6163 npm version ${VERSION} --allow-same-version
@@ -68,37 +70,23 @@ jobs:
6870 id : package-version
6971 uses : martinbeentjes/npm-get-version-action@master
7072
71- - name : Commit files
72- # if: github.event.pull_request.merged == true && contains(github.event.commits[0].message, '[skip-ci]') == false
73- run : |
74- git config --local user.email "action@github.com"
75- git config --local user.name "GitHub Action"
76- git add .
77- git commit -m "Release [skip-ci]" -a || true
78-
79- - name : Push changes
80- # if: github.event.pull_request.merged == true && contains(github.event.commits[0].message, '[skip-ci]') == false
81- uses : ad-m/github-push-action@master
73+ - name : Commit updated library package.json version
74+ uses : stefanzweifel/git-auto-commit-action@v4
8275 with :
83- github_token : ${{ secrets.ACTION_AUTH_TOKEN }}
84- tags : true
85- force : true
76+ branch : ${{ github.event.release.target_commitish }}
77+ commit_message : chore($LIBRARY)"':'" released $VERSION
78+ commit_user_name : GitHub Action
79+ commit_user_email : action@github.com
80+ commit_author : Author <actions@github.com>
81+ file_pattern : packages/$LIBRARY/package.json
82+ push_options : ' --force -a || true'
8683
8784 - name : Deploy
8885
89- # if: github.event.pull_request.merged == true && contains(github.event.commits[0].message, '[skip-ci]') == false
9086 run : |
91- LATEST_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
92- arrIN=(${LATEST_TAG//_/ })
93- LIBRARY=${arrIN[0]}
94- VERSION=${arrIN[1]}
95- echo "DEPLOY"
96- echo $LIBS
97- echo $VERSION
98- npm config set registry https://registry.npmjs.org/
87+ echo "Publishing on npmjs ${LIBRARY} - version: ${VERSION}"
9988 if [ -d "$PWD/packages/$LIBRARY" ]; then
10089 cd $PWD/packages/$LIBRARY
101- npm config set scope rbtechdev
10290 npm publish --access=public --ignore-scripts
10391 else
10492 echo "No library: ${LIBRARY}"
0 commit comments