Skip to content

Commit

Permalink
chore: use changesets to manage release (#706)
Browse files Browse the repository at this point in the history
  • Loading branch information
KhudaDad414 authored Jul 7, 2023
1 parent b00d0ec commit 7f2463d
Show file tree
Hide file tree
Showing 22 changed files with 20,220 additions and 27,128 deletions.
15 changes: 15 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": ["design-system"],
"privatePackages": {
"version": true,
"tag": true
}
}
116 changes: 0 additions & 116 deletions .github/workflows/if-nodejs-release.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/publish-docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Create and publish studio Docker image

on:
release:
types: published

jobs:
build-and-push-image:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
file: ./apps/studio/Dockerfile
push: true
tags: asyncapi/studio:latest
56 changes: 56 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# 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

on:
push:
branches:
- master

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Version or Create a Release in Github
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@v3
with:
token: ${{ secrets.GH_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- name: Install dependencies
run: npm install
- name: Create Release Pull Request or Release
uses: changesets/action@v1
with:
publish: npm run publish
version: npm run version-packages
commit: "version packages"
title: "chore: version packages"
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GIT_AUTHOR_NAME: asyncapi-bot
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_NAME: asyncapi-bot
GIT_COMMITTER_EMAIL: [email protected]
- 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'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }}
2 changes: 1 addition & 1 deletion apps/design-system/.storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'ui/styles.css'
import '@asyncapi/studio-ui/styles.css'

export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
Expand Down
28 changes: 3 additions & 25 deletions apps/design-system/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "design-system",
"version": "1.0.0",
"version": "0.0.0",
"private": true,
"dependencies": {
"@headlessui/react": "^1.7.13",
Expand All @@ -12,18 +12,16 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^4.8.0",
"ui": "*",
"@asyncapi/studio-ui": "*",
"web-vitals": "^2.1.4"
},
"scripts": {
"lint": "echo \"No linter configured yet\"",
"generate:assets": "echo \"No assets to configure\"",
"bump:version": "../../bump-version.sh design-system",
"test": "echo \"No tests\"",
"eject": "react-scripts eject",
"dev": "storybook dev -p 6006 --no-open",
"build": "storybook build",
"release": "semantic-release -e semantic-release-monorepo"
"build": "storybook build"
},
"eslintConfig": {
"extends": [
Expand Down Expand Up @@ -74,25 +72,5 @@
},
"publishConfig": {
"access": "public"
},
"release": {
"branches": [
"master"
],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "conventionalcommits"
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits"
}
],
"@semantic-release/github"
]
}
}
2 changes: 1 addition & 1 deletion apps/design-system/src/components/DropdownMenu.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable import/no-anonymous-default-export */
import { DropdownMenu } from 'ui'
import { DropdownMenu } from '@asyncapi/studio-ui'

export default {
component: DropdownMenu,
Expand Down
2 changes: 1 addition & 1 deletion apps/design-system/src/components/Logo.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable import/no-anonymous-default-export */
import { Logo } from 'ui';
import { Logo } from '@asyncapi/studio-ui';

export default {
component: Logo,
Expand Down
2 changes: 1 addition & 1 deletion apps/design-system/src/components/Modal.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable import/no-anonymous-default-export */
import { Modal } from 'ui';
import { Modal } from '@asyncapi/studio-ui';

export default {
component: Modal,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { OperationIcon } from 'ui';
import { OperationIcon } from '@asyncapi/studio-ui';

export default {
component: OperationIcon,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable import/no-anonymous-default-export */
import { ProtocolBadge } from 'ui'
import { ProtocolBadge } from '@asyncapi/studio-ui'

export default {
component: ProtocolBadge,
Expand Down
4 changes: 2 additions & 2 deletions apps/design-system/src/components/Sidebar.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable import/no-anonymous-default-export */
import { Sidebar } from 'ui'
import { Sidebar } from '@asyncapi/studio-ui'

import { ServerStackIcon, MapIcon, SquaresPlusIcon, ScaleIcon, UsersIcon, AdjustmentsHorizontalIcon, PlusIcon, MagnifyingGlassIcon } from 'ui/icons'
import { ServerStackIcon, MapIcon, SquaresPlusIcon, ScaleIcon, UsersIcon, AdjustmentsHorizontalIcon, PlusIcon, MagnifyingGlassIcon } from '@asyncapi/studio-ui/icons'

export default {
component: Sidebar,
Expand Down
2 changes: 1 addition & 1 deletion apps/design-system/src/components/SlideOver.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState } from "react";
import { SlideOver } from "ui";
import { SlideOver } from "@asyncapi/studio-ui";

export default {
component: SlideOver,
Expand Down
4 changes: 2 additions & 2 deletions apps/design-system/src/components/Toolbar.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable import/no-anonymous-default-export */
import { Toolbar } from 'ui'
import { Toolbar } from '@asyncapi/studio-ui'

import { ListBulletIcon, CodeBracketSquareIcon, DocumentTextIcon, EllipsisVerticalIcon } from 'ui/icons'
import { ListBulletIcon, CodeBracketSquareIcon, DocumentTextIcon, EllipsisVerticalIcon } from '@asyncapi/studio-ui/icons'

export default {
component: Toolbar,
Expand Down
2 changes: 1 addition & 1 deletion apps/design-system/src/components/Tooltip.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable import/no-anonymous-default-export */
import React from 'react'
import { Tooltip } from 'ui'
import { Tooltip } from '@asyncapi/studio-ui'

export default {
component: Tooltip.Content,
Expand Down
4 changes: 2 additions & 2 deletions apps/design-system/src/design-tokens/Icons.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
UsersIcon,
WebSocketIcon,
XMarkIcon,
} from 'ui/icons'
} from '@asyncapi/studio-ui/icons'

<Meta
title="Design Tokens/Icons"
Expand Down Expand Up @@ -91,7 +91,7 @@ Most of the icons below are taken from https://heroicons.com. If you need to add
### Example

```jsx
import { MapIcon } from 'ui/icons'
import { MapIcon } from '@asyncapi/studio-ui/icons'

...

Expand Down
2 changes: 1 addition & 1 deletion apps/studio/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ WORKDIR /app
COPY .gitignore .gitignore
COPY --from=builder /app/out/json/ .
COPY --from=builder /app/out/package-lock.json ./package-lock.json
RUN npm ci
RUN PUPPETEER_SKIP_DOWNLOAD=true npm ci

# Build the project
COPY --from=builder /app/out/full/ .
Expand Down
Loading

0 comments on commit 7f2463d

Please sign in to comment.