Skip to content

Commit 8d5d27a

Browse files
committed
Merge remote-tracking branch 'upstream/master' into ux-fix
2 parents 5a18602 + 908fb7f commit 8d5d27a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+3206
-28347
lines changed

.asyncapi-cli

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"current":"eight-context","store":{"seven-context":".","eight-context":"."}}

.changeset/config.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json",
3+
"changelog": ["@changesets/changelog-git", { "repo": "asyncapi/cli" }],
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "master",
9+
"updateInternalDependencies": "patch",
10+
"privatePackages": {
11+
"version": true,
12+
"tag": true
13+
}
14+
}

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

Lines changed: 0 additions & 69 deletions
This file was deleted.

.github/workflows/release-docker.yml

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ on:
55
- published
66

77
jobs:
8-
98
publish-docker:
109
name: Generating Docker
1110
runs-on: ubuntu-latest
@@ -17,6 +16,11 @@ jobs:
1716
VERSION_WITHOUT_V=${VERSION:1}
1817
echo "value=${VERSION_WITHOUT_V}" >> $GITHUB_OUTPUT
1918
19+
- name : Checkout repository
20+
uses: actions/checkout@v4
21+
with:
22+
ref: ${{ github.event.release.tag_name }}
23+
2024
- name: Set Up QEMU
2125
uses: docker/setup-qemu-action@v2
2226

@@ -29,10 +33,6 @@ jobs:
2933
username: ${{ secrets.DOCKER_USERNAME }}
3034
password: ${{ secrets.DOCKER_PASSWORD }}
3135

32-
# This workflow triggers on GitHub Release, but it may start before the npm package is published.
33-
- name: Sleep for 30 sec
34-
run: sleep 30s
35-
3636
- name: Build Image
3737
uses: docker/build-push-action@v4
3838
with:
@@ -56,3 +56,45 @@ jobs:
5656
pass: ${{ secrets.DOCKER_PASSWORD }}
5757
slug: asyncapi/cli
5858
description: CLI to work with your AsyncAPI files
59+
60+
publish-action-docker:
61+
name: Release github action for cli and update version in action.yml
62+
runs-on: ubuntu-latest
63+
env:
64+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
65+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
66+
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
67+
68+
steps:
69+
- name: Checkout repository
70+
uses: actions/checkout@v4
71+
with:
72+
ref: master
73+
74+
- name: Get version without v character
75+
id: version
76+
run: |
77+
VERSION=${{github.event.release.tag_name}}
78+
VERSION_WITHOUT_V=${VERSION:1}
79+
echo "value=${VERSION_WITHOUT_V}" >> $GITHUB_OUTPUT
80+
81+
- name: Release to Docker
82+
run: |
83+
echo ${{env.DOCKER_PASSWORD}} | docker login -u ${{env.DOCKER_USERNAME}} --password-stdin
84+
npm run action:docker:build
85+
docker tag asyncapi/github-action-for-cli:latest asyncapi/github-action-for-cli:${{ steps.version.outputs.value }}
86+
docker push asyncapi/github-action-for-cli:${{ steps.version.outputs.value }}
87+
docker push asyncapi/github-action-for-cli:latest
88+
89+
- name: Change directory to github-action
90+
run: |
91+
cd github-action/
92+
ls -la
93+
94+
- uses: meeDamian/sync-readme@v1.0.6
95+
with:
96+
user: ${{ env.DOCKER_USERNAME }}
97+
pass: ${{ env.DOCKER_PASSWORD }}
98+
slug: asyncapi/github-action-for-cli
99+
description: Github action for AsyncAPI CLI
100+

.github/workflows/if-nodejs-release.yml renamed to .github/workflows/release-with-changesets.yml

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
# This action is centrally managed in https://github.com/asyncapi/.github/
2-
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo
3-
4-
# It does magic only if there is package.json file in the root of the project
5-
name: Release - if Node project
1+
# It does magic only if there is a package.json file in the root of the project
2+
name: Release
63

74
on:
85
push:
96
branches:
107
- master
11-
# below lines are not enough to have release supported for these branches
12-
# make sure configuration of `semantic-release` package mentions these branches
8+
# The below lines are not enough to have release supported for these branches
139
- next-spec
1410
- next-major
1511
- next-major-spec
@@ -18,26 +14,26 @@ on:
1814
- next
1915

2016
jobs:
21-
2217
test-nodejs:
23-
# We just check the message of first commit as there is always just one commit because we squash into one before merging
24-
# "commits" contains array of objects where one of the properties is commit "message"
18+
# We just check the message of the first commit as there is always just one commit because we squash into one before merging
19+
# "commits" contains an array of objects where one of the properties is the commit "message"
2520
# Release workflow will be skipped if release conventional commits are not used
2621
if: |
27-
startsWith( github.repository, 'asyncapi/' ) &&
22+
startsWith( github.repository, 'asyncapi/' ) &&
2823
(startsWith( github.event.commits[0].message , 'fix:' ) ||
2924
startsWith( github.event.commits[0].message, 'fix!:' ) ||
3025
startsWith( github.event.commits[0].message, 'feat:' ) ||
26+
startsWith( github.event.commits[0].message, 'chore(release):' ) ||
3127
startsWith( github.event.commits[0].message, 'feat!:' ))
3228
name: Test NodeJS release on ${{ matrix.os }}
3329
runs-on: ${{ matrix.os }}
3430
strategy:
3531
matrix:
36-
# Using macos-13 instead of latest (macos-14) due to an issue with Puppeteer and such runner.
32+
# Using macos-13 instead of latest (macos-14) due to an issue with Puppeteer and such runner.
3733
# See: https://github.com/puppeteer/puppeteer/issues/12327 and https://github.com/asyncapi/parser-js/issues/1001
3834
os: [ubuntu-latest, macos-13, windows-latest]
3935
steps:
40-
- name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows
36+
- name: Set git to use LF # To once and for all finish the never-ending fight between Unix and Windows
4137
run: |
4238
git config --global core.autocrlf false
4339
git config --global core.eol lf
@@ -60,7 +56,7 @@ jobs:
6056
- if: steps.lockversion.outputs.version == '18' && matrix.os == 'windows-latest'
6157
name: Install npm cli 8
6258
shell: bash
63-
#npm cli 10 is buggy because of some cache issues
59+
# npm cli 10 is buggy because of some cache issues
6460
run: npm install -g npm@8.19.4
6561
- if: steps.packagejson.outputs.exists == 'true'
6662
name: Install dependencies
@@ -75,16 +71,16 @@ jobs:
7571
with:
7672
status: ${{ job.status }}
7773
fields: repo,action,workflow
78-
text: 'Release workflow failed in testing job'
74+
text: "Release workflow failed in testing job"
7975
env:
8076
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }}
8177

8278
release:
8379
needs: [test-nodejs]
84-
name: Publish to any of NPM, Github, or Docker Hub
80+
name: Publish to any of NPM, GitHub, or Docker Hub
8581
runs-on: ubuntu-latest
8682
steps:
87-
- name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows
83+
- name: Set git to use LF # To once and for all finish the never-ending fight between Unix and Windows
8884
run: |
8985
git config --global core.autocrlf false
9086
git config --global core.eol lf
@@ -108,27 +104,35 @@ jobs:
108104
shell: bash
109105
run: npm ci
110106
- if: steps.packagejson.outputs.exists == 'true'
111-
name: Add plugin for conventional commits for semantic-release
112-
run: npm install --save-dev conventional-changelog-conventionalcommits@5.0.0
107+
name: Install changelog
108+
shell: bash
109+
# This step can be removed once the issue is fixed in the changeset package.
110+
run: npm install @changesets/changelog-git@0.2.0
111+
113112
- if: steps.packagejson.outputs.exists == 'true'
114113
name: Publish to any of NPM, Github, and Docker Hub
114+
#this step has 2 goals, it is either identifying that there is changeset file created and then this action creates a PR with version bump that will trigger release - or if it sees there is no changeset, and there are versions changes in package.json files, it publish new versions to NPM is they are not there yet
115+
uses: changesets/action@v1
115116
id: release
117+
with:
118+
version: npm run bump:version
119+
commit: "chore(release): release and bump versions of packages"
120+
title: "chore(release): release and bump versions of packages"
121+
publish: npx -p @changesets/cli@2.27.7 changeset publish
122+
setupGitUser: false
116123
env:
117124
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
118125
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
119-
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
120-
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
121126
GIT_AUTHOR_NAME: asyncapi-bot
122127
GIT_AUTHOR_EMAIL: info@asyncapi.io
123128
GIT_COMMITTER_NAME: asyncapi-bot
124129
GIT_COMMITTER_EMAIL: info@asyncapi.io
125-
run: npx semantic-release@19.0.4
126-
- if: failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel
130+
- if: failure() # Only, on failure, send a message on the 94_bot-failing-ci Slack channel
127131
name: Report workflow run status to Slack
128132
uses: 8398a7/action-slack@v3
129133
with:
130134
status: ${{ job.status }}
131135
fields: repo,action,workflow
132-
text: 'Release workflow failed in release job'
136+
text: "Release workflow failed in release job"
133137
env:
134138
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }}

0 commit comments

Comments
 (0)