-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: update of files from global .github repo (#367)
- Loading branch information
1 parent
ec4ee5f
commit 61915dd
Showing
3 changed files
with
48 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,24 +39,28 @@ jobs: | |
git config --global core.autocrlf false | ||
git config --global core.eol lf | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
- name: Check if Node.js project and has package.json | ||
id: packagejson | ||
run: test -e ./package.json && echo "::set-output name=exists::true" || echo "::set-output name=exists::false" | ||
run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT | ||
shell: bash | ||
- if: steps.packagejson.outputs.exists == 'true' | ||
name: Check package-lock version | ||
uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master | ||
id: lockversion | ||
- if: steps.packagejson.outputs.exists == 'true' | ||
name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 14 | ||
node-version: "${{ steps.lockversion.outputs.version }}" | ||
cache: 'npm' | ||
cache-dependency-path: '**/package-lock.json' | ||
- if: steps.packagejson.outputs.exists == 'true' | ||
name: Install dependencies | ||
run: npm install | ||
- if: steps.packagejson.outputs.exists == 'true' | ||
name: Run test | ||
run: npm test | ||
run: npm test --if-present | ||
- if: failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel | ||
name: Report workflow run status to Slack | ||
uses: 8398a7/action-slack@v3 | ||
|
@@ -69,26 +73,43 @@ jobs: | |
|
||
release: | ||
needs: [test-nodejs] | ||
name: Publish to any of NPM, Github, and Docker Hub | ||
name: Publish to any of NPM, Github, or Docker Hub | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows | ||
run: | | ||
git config --global core.autocrlf false | ||
git config --global core.eol lf | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
- name: Check if Node.js project and has package.json | ||
id: packagejson | ||
run: test -e ./package.json && echo "::set-output name=exists::true" || echo "::set-output name=exists::false" | ||
run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT | ||
shell: bash | ||
- if: steps.packagejson.outputs.exists == 'true' | ||
name: Check package-lock version | ||
uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master | ||
id: lockversion | ||
- if: steps.packagejson.outputs.exists == 'true' | ||
name: Setup Node.js | ||
uses: actions/setup-node@v1 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 14 | ||
node-version: "${{ steps.lockversion.outputs.version }}" | ||
cache: 'npm' | ||
cache-dependency-path: '**/package-lock.json' | ||
- if: steps.packagejson.outputs.exists == 'true' | ||
name: Install dependencies | ||
run: npm install | ||
id: first-installation | ||
run: npm ci | ||
continue-on-error: true | ||
- if: steps.first-installation.outputs.status == 'failure' && steps.packagejson.outputs.exists == 'true' | ||
name: Clear NPM cache and install deps again | ||
run: | | ||
npm cache clean --force | ||
npm ci | ||
- if: steps.packagejson.outputs.exists == 'true' | ||
name: Add plugin for conventional commits for semantic-release | ||
run: npm install --save-dev [email protected] | ||
- if: steps.packagejson.outputs.exists == 'true' | ||
name: Publish to any of NPM, Github, and Docker Hub | ||
id: release | ||
|
@@ -101,7 +122,7 @@ jobs: | |
GIT_AUTHOR_EMAIL: [email protected] | ||
GIT_COMMITTER_NAME: asyncapi-bot | ||
GIT_COMMITTER_EMAIL: [email protected] | ||
run: npm run release | ||
run: npx semantic-release@19.0.4 | ||
- if: failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel | ||
name: Report workflow run status to Slack | ||
uses: 8398a7/action-slack@v3 | ||
|
@@ -110,4 +131,4 @@ jobs: | |
fields: repo,action,workflow | ||
text: 'Release workflow failed in release job' | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }} | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters