Skip to content

Commit 32129dc

Browse files
authored
ci: update of files from global .github repo (#184)
1 parent 3c419c8 commit 32129dc

File tree

4 files changed

+61
-22
lines changed

4 files changed

+61
-22
lines changed

.github/workflows/bump.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ jobs:
2020
runs-on: ubuntu-latest
2121
steps:
2222
- name: Checkout repo
23-
uses: actions/checkout@v2
23+
uses: actions/checkout@v3
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
2727
- if: steps.packagejson.outputs.exists == 'true'
2828
name: Bumping latest version of this package in other repositories
29-
uses: derberg/npm-dependency-manager-for-your-github-org@v4
29+
uses: derberg/npm-dependency-manager-for-your-github-org@26a4f13d740254719971325046822a169aaa7441 # using v5.-.- https://github.com/derberg/npm-dependency-manager-for-your-github-org/releases/tag/v5.0.0
3030
with:
3131
github_token: ${{ secrets.GH_TOKEN }}
3232
committer_username: asyncapi-bot
3333
committer_email: info@asyncapi.io
34-
repos_to_ignore: html-template # this is temporary until react component releases 1.0, then it can be removed
34+
repos_to_ignore: html-template # this is temporary until react component releases 1.0, then it can be removed

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

Lines changed: 25 additions & 12 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,35 @@ 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+
- if: steps.packagejson.outputs.exists == 'true'
89+
name: Check package-lock version
90+
uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master
91+
id: lockversion
8492
- if: steps.packagejson.outputs.exists == 'true'
8593
name: Setup Node.js
86-
uses: actions/setup-node@v1
94+
uses: actions/setup-node@v3
8795
with:
88-
node-version: 14
96+
node-version: "${{ steps.lockversion.outputs.version }}"
97+
cache: 'npm'
98+
cache-dependency-path: '**/package-lock.json'
8999
- if: steps.packagejson.outputs.exists == 'true'
90100
name: Install dependencies
91101
run: npm install
102+
- if: steps.packagejson.outputs.exists == 'true'
103+
name: Add plugin for conventional commits for semantic-release
104+
run: npm install --save-dev conventional-changelog-conventionalcommits@5.0.0
92105
- if: steps.packagejson.outputs.exists == 'true'
93106
name: Publish to any of NPM, Github, and Docker Hub
94107
id: release
@@ -101,7 +114,7 @@ jobs:
101114
GIT_AUTHOR_EMAIL: info@asyncapi.io
102115
GIT_COMMITTER_NAME: asyncapi-bot
103116
GIT_COMMITTER_EMAIL: info@asyncapi.io
104-
run: npm run release
117+
run: npx semantic-release@19.0.4
105118
- if: failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel
106119
name: Report workflow run status to Slack
107120
uses: 8398a7/action-slack@v3
@@ -110,4 +123,4 @@ jobs:
110123
fields: repo,action,workflow
111124
text: 'Release workflow failed in release job'
112125
env:
113-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }}
126+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }}

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

Lines changed: 10 additions & 6 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
3640
run: npm install
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}}'

.releaserc

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
branches:
3+
- master
4+
# by default release workflow reacts on push not only to master.
5+
#This is why out of the box sematic release is configured for all these branches
6+
- name: next-spec
7+
prerelease: true
8+
- name: next-major
9+
prerelease: true
10+
- name: next-major-spec
11+
prerelease: true
12+
- name: beta
13+
prerelease: true
14+
- name: alpha
15+
prerelease: true
16+
plugins:
17+
- - "@semantic-release/commit-analyzer"
18+
- preset: conventionalcommits
19+
- - "@semantic-release/release-notes-generator"
20+
- preset: conventionalcommits
21+
- "@semantic-release/npm"
22+
- "@semantic-release/github"

0 commit comments

Comments
 (0)