Skip to content

Commit

Permalink
Merge branch 'master' into boyney123-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
magicmatatjahu authored Jul 20, 2023
2 parents a8485d4 + cf22431 commit 1c0de38
Show file tree
Hide file tree
Showing 8 changed files with 118 additions and 17,885 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
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
- if: steps.packagejson.outputs.exists == 'true'
name: Bumping latest version of this package in other repositories
uses: derberg/npm-dependency-manager-for-your-github-org@v4
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
with:
github_token: ${{ secrets.GH_TOKEN }}
committer_username: asyncapi-bot
committer_email: [email protected]
repos_to_ignore: html-template # this is temporary until react component releases 1.0, then it can be removed
repos_to_ignore: html-template # this is temporary until react component releases 1.0, then it can be removed
33 changes: 22 additions & 11 deletions .github/workflows/if-nodejs-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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@v3
with:
node-version: 18
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
Expand All @@ -69,28 +73,35 @@ 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
- 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: 18
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: 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
Expand All @@ -103,7 +114,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
Expand All @@ -112,4 +123,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 }}
30 changes: 25 additions & 5 deletions .github/workflows/if-nodejs-version-bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,32 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
# target branch of release. More info https://docs.github.com/en/rest/reference/repos#releases
# in case release is created from release branch then we need to checkout from given branch
# if @semantic-release/github is used to publish, the minimum version is 7.2.0 for proper working
ref: ${{ github.event.release.target_commitish }}
- 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
- 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@v3
with:
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: Assets generation
run: npm run generate:assets
run: npm run generate:assets --if-present
- if: steps.packagejson.outputs.exists == 'true'
name: Bump version in package.json
# There is no need to substract "v" from the tag as version script handles it
Expand All @@ -38,12 +49,21 @@ jobs:
run: VERSION=${{github.event.release.tag_name}} npm run bump:version
- if: steps.packagejson.outputs.exists == 'true'
name: Create Pull Request with updated asset files including package.json
uses: peter-evans/create-pull-request@v3
uses: peter-evans/create-pull-request@38e0b6e68b4c852a5500a94740f0e535e0d7ba54 # use 4.2.4 https://github.com/peter-evans/create-pull-request/releases/tag/v4.2.4
with:
token: ${{ secrets.GH_TOKEN }}
commit-message: 'chore(release): ${{github.event.release.tag_name}}'
committer: asyncapi-bot <[email protected]>
author: asyncapi-bot <[email protected]>
title: 'chore(release): ${{github.event.release.tag_name}}'
body: 'Version bump in package.json for release [${{github.event.release.tag_name}}](${{github.event.release.html_url}})'
branch: version-bump/${{github.event.release.tag_name}}
branch: version-bump/${{github.event.release.tag_name}}
- 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
with:
status: ${{ job.status }}
fields: repo,action,workflow
text: 'Unable to bump the version in package.json after the release'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }}
22 changes: 22 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
branches:
- master
# by default release workflow reacts on push not only to master.
#This is why out of the box sematic release is configured for all these branches
- name: next-spec
prerelease: true
- name: next-major
prerelease: true
- name: next-major-spec
prerelease: true
- name: beta
prerelease: true
- name: alpha
prerelease: true
plugins:
- - "@semantic-release/commit-analyzer"
- preset: conventionalcommits
- - "@semantic-release/release-notes-generator"
- preset: conventionalcommits
- "@semantic-release/npm"
- "@semantic-release/github"
24 changes: 13 additions & 11 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ $ npm install -g @asyncapi/cli
$ asyncapi COMMAND
running command...
$ asyncapi (--version)
@asyncapi/cli/0.50.1 linux-x64 node-v18.16.1
@asyncapi/cli/0.50.2 linux-x64 node-v18.16.1
$ asyncapi --help [COMMAND]
USAGE
$ asyncapi COMMAND
Expand Down Expand Up @@ -91,7 +91,7 @@ EXAMPLES
$ asyncapi bundle ./asyncapi.yaml ./features.yaml --base ./asyncapi.yaml --reference-into-components
```

_See code: [src/commands/bundle.ts](https://github.com/asyncapi/cli/blob/v0.50.1/src/commands/bundle.ts)_
_See code: [src/commands/bundle.ts](https://github.com/asyncapi/cli/blob/v0.50.2/src/commands/bundle.ts)_

## `asyncapi config`

Expand All @@ -105,7 +105,7 @@ DESCRIPTION
CLI config settings
```

_See code: [src/commands/config/index.ts](https://github.com/asyncapi/cli/blob/v0.50.1/src/commands/config/index.ts)_
_See code: [src/commands/config/index.ts](https://github.com/asyncapi/cli/blob/v0.50.2/src/commands/config/index.ts)_

## `asyncapi config context`

Expand Down Expand Up @@ -234,7 +234,7 @@ DESCRIPTION
Convert asyncapi documents older to newer versions
```

_See code: [src/commands/convert.ts](https://github.com/asyncapi/cli/blob/v0.50.1/src/commands/convert.ts)_
_See code: [src/commands/convert.ts](https://github.com/asyncapi/cli/blob/v0.50.2/src/commands/convert.ts)_

## `asyncapi diff OLD NEW`

Expand Down Expand Up @@ -289,7 +289,7 @@ DESCRIPTION
Find diff between two asyncapi files
```

_See code: [src/commands/diff.ts](https://github.com/asyncapi/cli/blob/v0.50.1/src/commands/diff.ts)_
_See code: [src/commands/diff.ts](https://github.com/asyncapi/cli/blob/v0.50.2/src/commands/diff.ts)_

## `asyncapi generate`

Expand All @@ -303,7 +303,7 @@ DESCRIPTION
Generate typed models or other things like clients, applications or docs using AsyncAPI Generator templates.
```

_See code: [src/commands/generate/index.ts](https://github.com/asyncapi/cli/blob/v0.50.1/src/commands/generate/index.ts)_
_See code: [src/commands/generate/index.ts](https://github.com/asyncapi/cli/blob/v0.50.2/src/commands/generate/index.ts)_

## `asyncapi generate fromTemplate ASYNCAPI TEMPLATE`

Expand Down Expand Up @@ -348,7 +348,7 @@ Generates typed models
USAGE
$ asyncapi generate models LANGUAGE FILE [-h] [-o <value>] [--tsModelType class|interface] [--tsEnumType
enum|union] [--tsModuleSystem ESM|CJS] [--tsIncludeComments] [--tsExportType default|named] [--tsJsonBinPack]
[--tsMarshalling] [--packageName <value>] [--namespace <value>] [--csharpAutoImplement] [--csharpNewtonsoft]
[--tsMarshalling] [--tsExampleInstance] [--packageName <value>] [--namespace <value>] [--csharpAutoImplement] [--csharpNewtonsoft]
[--csharpArrayType Array|List] [--csharpHashcode] [--csharpEqual] [--csharpSystemJson] [--log-diagnostics]
[--diagnostics-format json|stylish|junit|html|text|teamcity|pretty] [--fail-severity error|warn|info|hint]
Expand Down Expand Up @@ -398,6 +398,8 @@ FLAGS
serializing to and from binary with jsonbinpack.
--tsMarshalling TypeScript specific, generate the models with
marshalling functions.
--tsExampleInstance Typescript specific, generate examples with
the models
--tsModelType=<option> [default: class] TypeScript specific, define
which type of model needs to be generated.
<options: class|interface>
Expand Down Expand Up @@ -429,7 +431,7 @@ DESCRIPTION
Creates a new asyncapi file
```

_See code: [src/commands/new/index.ts](https://github.com/asyncapi/cli/blob/v0.50.1/src/commands/new/index.ts)_
_See code: [src/commands/new/index.ts](https://github.com/asyncapi/cli/blob/v0.50.2/src/commands/new/index.ts)_

## `asyncapi new file`

Expand Down Expand Up @@ -517,7 +519,7 @@ EXAMPLES
$ asyncapi optimize ./asyncapi.yaml --optimization=remove-components,reuse-components,move-to-components --output=terminal --no-tty
```

_See code: [src/commands/optimize.ts](https://github.com/asyncapi/cli/blob/v0.50.1/src/commands/optimize.ts)_
_See code: [src/commands/optimize.ts](https://github.com/asyncapi/cli/blob/v0.50.2/src/commands/optimize.ts)_

## `asyncapi start`

Expand All @@ -531,7 +533,7 @@ DESCRIPTION
Start asyncapi studio
```

_See code: [src/commands/start/index.ts](https://github.com/asyncapi/cli/blob/v0.50.1/src/commands/start/index.ts)_
_See code: [src/commands/start/index.ts](https://github.com/asyncapi/cli/blob/v0.50.2/src/commands/start/index.ts)_

## `asyncapi start studio`

Expand Down Expand Up @@ -575,5 +577,5 @@ DESCRIPTION
validate asyncapi file
```

_See code: [src/commands/validate.ts](https://github.com/asyncapi/cli/blob/v0.50.1/src/commands/validate.ts)_
_See code: [src/commands/validate.ts](https://github.com/asyncapi/cli/blob/v0.50.2/src/commands/validate.ts)_
<!-- commandsstop -->
Loading

0 comments on commit 1c0de38

Please sign in to comment.