Skip to content

Commit 777dfb6

Browse files
Merge master into bot/bump-@asyncapi/generator-1.17.14
2 parents 410e31e + 61915dd commit 777dfb6

File tree

3 files changed

+48
-22
lines changed

3 files changed

+48
-22
lines changed

.github/workflows/if-nodejs-pr-testing.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
id: should_run
3434
name: Should Run
3535
run: echo "shouldrun=true" >> $GITHUB_OUTPUT
36+
shell: bash
3637
- if: steps.should_run.outputs.shouldrun == 'true'
3738
name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows
3839
run: |
@@ -60,13 +61,13 @@ jobs:
6061
- if: steps.packagejson.outputs.exists == 'true'
6162
name: Install dependencies
6263
id: first-installation
63-
run: npm install --loglevel verbose
64+
run: npm ci
6465
continue-on-error: true
6566
- if: steps.first-installation.outputs.status == 'failure' && steps.packagejson.outputs.exists == 'true'
6667
name: Clear NPM cache and install deps again
6768
run: |
6869
npm cache clean --force
69-
npm install --loglevel verbose
70+
npm ci
7071
- if: steps.packagejson.outputs.exists == 'true'
7172
name: Test
7273
run: npm test --if-present

.github/workflows/if-nodejs-release.yml

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,24 +39,28 @@ jobs:
3939
git config --global core.autocrlf false
4040
git config --global core.eol lf
4141
- name: Checkout repository
42-
uses: actions/checkout@v2
42+
uses: actions/checkout@v3
4343
- name: Check if Node.js project and has package.json
4444
id: packagejson
45-
run: test -e ./package.json && echo "::set-output name=exists::true" || echo "::set-output name=exists::false"
45+
run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT
4646
shell: bash
47+
- if: steps.packagejson.outputs.exists == 'true'
48+
name: Check package-lock version
49+
uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master
50+
id: lockversion
4751
- if: steps.packagejson.outputs.exists == 'true'
4852
name: Setup Node.js
49-
uses: actions/setup-node@v2
53+
uses: actions/setup-node@v3
5054
with:
51-
node-version: 14
55+
node-version: "${{ steps.lockversion.outputs.version }}"
5256
cache: 'npm'
5357
cache-dependency-path: '**/package-lock.json'
5458
- if: steps.packagejson.outputs.exists == 'true'
5559
name: Install dependencies
5660
run: npm install
5761
- if: steps.packagejson.outputs.exists == 'true'
5862
name: Run test
59-
run: npm test
63+
run: npm test --if-present
6064
- if: failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel
6165
name: Report workflow run status to Slack
6266
uses: 8398a7/action-slack@v3
@@ -69,26 +73,43 @@ jobs:
6973

7074
release:
7175
needs: [test-nodejs]
72-
name: Publish to any of NPM, Github, and Docker Hub
76+
name: Publish to any of NPM, Github, or Docker Hub
7377
runs-on: ubuntu-latest
7478
steps:
7579
- name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows
7680
run: |
7781
git config --global core.autocrlf false
7882
git config --global core.eol lf
7983
- name: Checkout repository
80-
uses: actions/checkout@v2
84+
uses: actions/checkout@v3
8185
- name: Check if Node.js project and has package.json
8286
id: packagejson
83-
run: test -e ./package.json && echo "::set-output name=exists::true" || echo "::set-output name=exists::false"
87+
run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT
88+
shell: bash
89+
- if: steps.packagejson.outputs.exists == 'true'
90+
name: Check package-lock version
91+
uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master
92+
id: lockversion
8493
- if: steps.packagejson.outputs.exists == 'true'
8594
name: Setup Node.js
86-
uses: actions/setup-node@v1
95+
uses: actions/setup-node@v3
8796
with:
88-
node-version: 14
97+
node-version: "${{ steps.lockversion.outputs.version }}"
98+
cache: 'npm'
99+
cache-dependency-path: '**/package-lock.json'
89100
- if: steps.packagejson.outputs.exists == 'true'
90101
name: Install dependencies
91-
run: npm install
102+
id: first-installation
103+
run: npm ci
104+
continue-on-error: true
105+
- if: steps.first-installation.outputs.status == 'failure' && steps.packagejson.outputs.exists == 'true'
106+
name: Clear NPM cache and install deps again
107+
run: |
108+
npm cache clean --force
109+
npm ci
110+
- if: steps.packagejson.outputs.exists == 'true'
111+
name: Add plugin for conventional commits for semantic-release
112+
run: npm install --save-dev [email protected]
92113
- if: steps.packagejson.outputs.exists == 'true'
93114
name: Publish to any of NPM, Github, and Docker Hub
94115
id: release
@@ -101,7 +122,7 @@ jobs:
101122
GIT_AUTHOR_EMAIL: [email protected]
102123
GIT_COMMITTER_NAME: asyncapi-bot
103124
GIT_COMMITTER_EMAIL: [email protected]
104-
run: npm run release
125+
run: npx semantic-release@19.0.4
105126
- if: failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel
106127
name: Report workflow run status to Slack
107128
uses: 8398a7/action-slack@v3
@@ -110,4 +131,4 @@ jobs:
110131
fields: repo,action,workflow
111132
text: 'Release workflow failed in release job'
112133
env:
113-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }}
134+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }}

.github/workflows/if-nodejs-version-bump.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,32 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: Checkout repository
18-
uses: actions/checkout@v2
18+
uses: actions/checkout@v3
1919
with:
2020
# target branch of release. More info https://docs.github.com/en/rest/reference/repos#releases
2121
# in case release is created from release branch then we need to checkout from given branch
2222
# if @semantic-release/github is used to publish, the minimum version is 7.2.0 for proper working
2323
ref: ${{ github.event.release.target_commitish }}
2424
- name: Check if Node.js project and has package.json
2525
id: packagejson
26-
run: test -e ./package.json && echo "::set-output name=exists::true" || echo "::set-output name=exists::false"
26+
run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT
27+
- if: steps.packagejson.outputs.exists == 'true'
28+
name: Check package-lock version
29+
uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master
30+
id: lockversion
2731
- if: steps.packagejson.outputs.exists == 'true'
2832
name: Setup Node.js
29-
uses: actions/setup-node@v2
33+
uses: actions/setup-node@v3
3034
with:
31-
node-version: 14
35+
node-version: "${{ steps.lockversion.outputs.version }}"
3236
cache: 'npm'
3337
cache-dependency-path: '**/package-lock.json'
3438
- if: steps.packagejson.outputs.exists == 'true'
3539
name: Install dependencies
36-
run: npm install
40+
run: npm ci
3741
- if: steps.packagejson.outputs.exists == 'true'
3842
name: Assets generation
39-
run: npm run generate:assets
43+
run: npm run generate:assets --if-present
4044
- if: steps.packagejson.outputs.exists == 'true'
4145
name: Bump version in package.json
4246
# There is no need to substract "v" from the tag as version script handles it
@@ -45,7 +49,7 @@ jobs:
4549
run: VERSION=${{github.event.release.tag_name}} npm run bump:version
4650
- if: steps.packagejson.outputs.exists == 'true'
4751
name: Create Pull Request with updated asset files including package.json
48-
uses: peter-evans/create-pull-request@v3
52+
uses: peter-evans/create-pull-request@38e0b6e68b4c852a5500a94740f0e535e0d7ba54 # use 4.2.4 https://github.com/peter-evans/create-pull-request/releases/tag/v4.2.4
4953
with:
5054
token: ${{ secrets.GH_TOKEN }}
5155
commit-message: 'chore(release): ${{github.event.release.tag_name}}'

0 commit comments

Comments
 (0)