Skip to content

Commit 09bded3

Browse files
author
Giuseppe Pennisi
committed
Merge branch 'develop'
2 parents ebe90ce + b86958f commit 09bded3

2 files changed

Lines changed: 31 additions & 41 deletions

File tree

.github/workflows/pr_on_master.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@ jobs:
3737
- uses: c-hive/gha-npm-cache@v1
3838
if: ${{ !env.ACT }}
3939

40+
- uses: nrwl/nx-set-shas@v2
41+
4042
- name: Install environment
4143
run: npm ci --include=dev
4244

43-
- name: Run lint
44-
run: npm run affected:lint -- --base="origin/master"
45-
46-
- name: Tests coverage
47-
run: npm run affected:test -- --base="origin/master" --codeCoverage
45+
- run: npx nx workspace-lint
46+
- run: npx nx format:check --base="origin/master" --code-coverage
47+
- run: npx nx affected --target=lint --parallel=3
48+
- run: npx nx affected --target=test --parallel=3 --ci --code-coverage
49+
- run: npx nx affected --target=build --parallel=3

.github/workflows/publish.yml

Lines changed: 24 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -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 }}
@@ -34,9 +33,18 @@ jobs:
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
@@ -48,14 +56,8 @@ jobs:
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

Comments
 (0)