Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into ux-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Souvikns committed Dec 29, 2024
2 parents 5a18602 + 908fb7f commit 8d5d27a
Show file tree
Hide file tree
Showing 64 changed files with 3,206 additions and 28,347 deletions.
1 change: 1 addition & 0 deletions .asyncapi-cli
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"current":"eight-context","store":{"seven-context":".","eight-context":"."}}
14 changes: 14 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": ["@changesets/changelog-git", { "repo": "asyncapi/cli" }],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"privatePackages": {
"version": true,
"tag": true
}
}
69 changes: 0 additions & 69 deletions .github/workflows/if-nodejs-version-bump.yml

This file was deleted.

52 changes: 47 additions & 5 deletions .github/workflows/release-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
- published

jobs:

publish-docker:
name: Generating Docker
runs-on: ubuntu-latest
Expand All @@ -17,6 +16,11 @@ jobs:
VERSION_WITHOUT_V=${VERSION:1}
echo "value=${VERSION_WITHOUT_V}" >> $GITHUB_OUTPUT
- name : Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}

- name: Set Up QEMU
uses: docker/setup-qemu-action@v2

Expand All @@ -29,10 +33,6 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

# This workflow triggers on GitHub Release, but it may start before the npm package is published.
- name: Sleep for 30 sec
run: sleep 30s

- name: Build Image
uses: docker/build-push-action@v4
with:
Expand All @@ -56,3 +56,45 @@ jobs:
pass: ${{ secrets.DOCKER_PASSWORD }}
slug: asyncapi/cli
description: CLI to work with your AsyncAPI files

publish-action-docker:
name: Release github action for cli and update version in action.yml
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: master

- name: Get version without v character
id: version
run: |
VERSION=${{github.event.release.tag_name}}
VERSION_WITHOUT_V=${VERSION:1}
echo "value=${VERSION_WITHOUT_V}" >> $GITHUB_OUTPUT
- name: Release to Docker
run: |
echo ${{env.DOCKER_PASSWORD}} | docker login -u ${{env.DOCKER_USERNAME}} --password-stdin
npm run action:docker:build
docker tag asyncapi/github-action-for-cli:latest asyncapi/github-action-for-cli:${{ steps.version.outputs.value }}
docker push asyncapi/github-action-for-cli:${{ steps.version.outputs.value }}
docker push asyncapi/github-action-for-cli:latest
- name: Change directory to github-action
run: |
cd github-action/
ls -la
- uses: meeDamian/[email protected]
with:
user: ${{ env.DOCKER_USERNAME }}
pass: ${{ env.DOCKER_PASSWORD }}
slug: asyncapi/github-action-for-cli
description: Github action for AsyncAPI CLI

Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
# This action is centrally managed in https://github.com/asyncapi/.github/
# 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

# It does magic only if there is package.json file in the root of the project
name: Release - if Node project
# It does magic only if there is a package.json file in the root of the project
name: Release

on:
push:
branches:
- master
# below lines are not enough to have release supported for these branches
# make sure configuration of `semantic-release` package mentions these branches
# The below lines are not enough to have release supported for these branches
- next-spec
- next-major
- next-major-spec
Expand All @@ -18,26 +14,26 @@ on:
- next

jobs:

test-nodejs:
# We just check the message of first commit as there is always just one commit because we squash into one before merging
# "commits" contains array of objects where one of the properties is commit "message"
# We just check the message of the first commit as there is always just one commit because we squash into one before merging
# "commits" contains an array of objects where one of the properties is the commit "message"
# Release workflow will be skipped if release conventional commits are not used
if: |
startsWith( github.repository, 'asyncapi/' ) &&
startsWith( github.repository, 'asyncapi/' ) &&
(startsWith( github.event.commits[0].message , 'fix:' ) ||
startsWith( github.event.commits[0].message, 'fix!:' ) ||
startsWith( github.event.commits[0].message, 'feat:' ) ||
startsWith( github.event.commits[0].message, 'chore(release):' ) ||
startsWith( github.event.commits[0].message, 'feat!:' ))
name: Test NodeJS release on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# Using macos-13 instead of latest (macos-14) due to an issue with Puppeteer and such runner.
# Using macos-13 instead of latest (macos-14) due to an issue with Puppeteer and such runner.
# See: https://github.com/puppeteer/puppeteer/issues/12327 and https://github.com/asyncapi/parser-js/issues/1001
os: [ubuntu-latest, macos-13, windows-latest]
steps:
- name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows
- name: Set git to use LF # To once and for all finish the never-ending fight between Unix and Windows
run: |
git config --global core.autocrlf false
git config --global core.eol lf
Expand All @@ -60,7 +56,7 @@ jobs:
- if: steps.lockversion.outputs.version == '18' && matrix.os == 'windows-latest'
name: Install npm cli 8
shell: bash
#npm cli 10 is buggy because of some cache issues
# npm cli 10 is buggy because of some cache issues
run: npm install -g [email protected]
- if: steps.packagejson.outputs.exists == 'true'
name: Install dependencies
Expand All @@ -75,16 +71,16 @@ jobs:
with:
status: ${{ job.status }}
fields: repo,action,workflow
text: 'Release workflow failed in testing job'
text: "Release workflow failed in testing job"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }}

release:
needs: [test-nodejs]
name: Publish to any of NPM, Github, or 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
- name: Set git to use LF # To once and for all finish the never-ending fight between Unix and Windows
run: |
git config --global core.autocrlf false
git config --global core.eol lf
Expand All @@ -108,27 +104,35 @@ jobs:
shell: bash
run: npm ci
- if: steps.packagejson.outputs.exists == 'true'
name: Add plugin for conventional commits for semantic-release
run: npm install --save-dev [email protected]
name: Install changelog
shell: bash
# This step can be removed once the issue is fixed in the changeset package.
run: npm install @changesets/[email protected]

- if: steps.packagejson.outputs.exists == 'true'
name: Publish to any of NPM, Github, and Docker Hub
#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
uses: changesets/action@v1
id: release
with:
version: npm run bump:version
commit: "chore(release): release and bump versions of packages"
title: "chore(release): release and bump versions of packages"
publish: npx -p @changesets/[email protected] changeset publish
setupGitUser: false
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
GIT_AUTHOR_NAME: asyncapi-bot
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_NAME: asyncapi-bot
GIT_COMMITTER_EMAIL: [email protected]
run: npx [email protected]
- if: failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel
- 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: 'Release workflow failed in release job'
text: "Release workflow failed in release job"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }}
Loading

0 comments on commit 8d5d27a

Please sign in to comment.