1717 - alpha
1818
1919jobs :
20-
21- test-nodejs :
22- # We just check the message of first commit as there is always just one commit because we squash into one before merging
23- # "commits" contains array of objects where one of the properties is commit "message"
24- # Release workflow will be skipped if release conventional commits are not used
25- if : |
26- startsWith( github.repository, 'asyncapi/' ) &&
27- (startsWith( github.event.commits[0].message , 'fix:' ) ||
28- startsWith( github.event.commits[0].message, 'fix!:' ) ||
29- startsWith( github.event.commits[0].message, 'feat:' ) ||
30- startsWith( github.event.commits[0].message, 'feat!:' ))
31- name : Test NodeJS release on ${{ matrix.os }}
32- runs-on : ${{ matrix.os }}
33- strategy :
34- matrix :
35- os : [ubuntu-latest, macos-latest, windows-latest]
36- steps :
37- - name : Set git to use LF # to once and for all finish neverending fight between Unix and Windows
38- run : |
39- git config --global core.autocrlf false
40- git config --global core.eol lf
41- - name : Checkout repository
42- uses : actions/checkout@v2
43- - name : Check if Node.js project and has package.json
44- id : packagejson
45- run : test -e ./package.json && echo "::set-output name=exists::true" || echo "::set-output name=exists::false"
46- shell : bash
47- - if : steps.packagejson.outputs.exists == 'true'
48- name : Setup Node.js
49- uses : actions/setup-node@v2
50- with :
51- node-version : 14
52- cache : ' npm'
53- cache-dependency-path : ' **/package-lock.json'
54- - if : steps.packagejson.outputs.exists == 'true'
55- name : Install dependencies
56- run : npm install
57- - if : steps.packagejson.outputs.exists == 'true'
58- name : Run test
59- run : npm test
60- - if : failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel
61- name : Report workflow run status to Slack
62- uses : 8398a7/action-slack@v3
63- with :
64- status : ${{ job.status }}
65- fields : repo,action,workflow
66- text : ' Release workflow failed in testing job'
67- env :
68- SLACK_WEBHOOK_URL : ${{ secrets.SLACK_CI_FAIL_NOTIFY }}
69-
7020 release :
71- needs : [test-nodejs]
7221 name : Publish to any of NPM, Github, and Docker Hub
7322 runs-on : ubuntu-latest
7423 steps :
@@ -77,18 +26,28 @@ jobs:
7726 git config --global core.autocrlf false
7827 git config --global core.eol lf
7928 - name : Checkout repository
80- uses : actions/checkout@v2
29+ uses : actions/checkout@v3
30+ with :
31+ token : ${{ secrets.GH_TOKEN }}
8132 - name : Check if Node.js project and has package.json
8233 id : packagejson
8334 run : test -e ./package.json && echo "::set-output name=exists::true" || echo "::set-output name=exists::false"
8435 - if : steps.packagejson.outputs.exists == 'true'
8536 name : Setup Node.js
86- uses : actions/setup-node@v1
37+ uses : actions/setup-node@v3
8738 with :
88- node-version : 14
39+ node-version : 18
8940 - if : steps.packagejson.outputs.exists == 'true'
9041 name : Install dependencies
9142 run : npm install
43+ - name : Check secrets
44+ run : |
45+ if [[ "${{ secrets.GH_TOKEN }}" == "" ]]; then
46+ echo "Secret is not available. Skipping..."
47+ exit 0
48+ else
49+ echo "Secret is available."
50+ fi
9251 - if : steps.packagejson.outputs.exists == 'true'
9352 name : Publish to any of NPM, Github, and Docker Hub
9453 id : release
@@ -97,10 +56,10 @@ jobs:
9756 NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
9857 DOCKER_USERNAME : ${{ secrets.DOCKER_USERNAME }}
9958 DOCKER_PASSWORD : ${{ secrets.DOCKER_PASSWORD }}
100- GIT_AUTHOR_NAME : asyncapi-bot
101- GIT_AUTHOR_EMAIL : info@asyncapi.io
102- GIT_COMMITTER_NAME : asyncapi-bot
103- GIT_COMMITTER_EMAIL : info@asyncapi.io
59+ GIT_AUTHOR_NAME : KhudaDad414
60+ GIT_AUTHOR_EMAIL : khudadad414@gmail.com
61+ GIT_COMMITTER_NAME : KhudaDad414
62+ GIT_COMMITTER_EMAIL : khudadad414@gmail.com
10463 run : npm run release
10564 - if : failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel
10665 name : Report workflow run status to Slack
11069 fields : repo,action,workflow
11170 text : ' Release workflow failed in release job'
11271 env :
113- SLACK_WEBHOOK_URL : ${{ secrets.SLACK_CI_FAIL_NOTIFY }}
72+ SLACK_WEBHOOK_URL : ${{ secrets.SLACK_CI_FAIL_NOTIFY }}
0 commit comments