Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI workflow for npm package publishing #144

Merged
merged 2 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: npm-publish

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Setup Node 🔧
uses: actions/setup-node@v3
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'
- name: Install Dependencies
run: |
npm install -g pnpm
pnpm i

- name: Build 🔧
run: |
pnpm run build

- name: Deploy 🚀
run: pnpm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion apps/storybook/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Preview } from '@storybook/react';
import { withThemeByClassName } from '@storybook/addon-themes';

import '@yorkie-ui/components/dist/styles.css';
import '@yorkie-ui/core/dist/styles.css';
import './preview.css';

const preview: Preview = {
Expand Down
4 changes: 2 additions & 2 deletions apps/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "0.5.33",
"type": "module",
"scripts": {
"prebuild": "pnpm --filter @yorkie-ui/components build",
"prebuild": "pnpm --filter @yorkie-ui/core build",
"build": "storybook build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"dev": "pnpm prebuild && storybook dev -p 6006"
Expand All @@ -28,7 +28,7 @@
"@typescript-eslint/eslint-plugin": "^7.15.0",
"@typescript-eslint/parser": "^7.15.0",
"@vitejs/plugin-react": "^4.3.1",
"@yorkie-ui/components": "workspace:^",
"@yorkie-ui/core": "workspace:^",
"eslint": "^8.57.0",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.7",
Expand Down
2 changes: 1 addition & 1 deletion apps/storybook/src/stories/button/Button.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react';
import { Button } from '@yorkie-ui/components';
import { Button } from '@yorkie-ui/core';
const meta = {
title: 'COMPONENTS / Button',
component: Button,
Expand Down
4 changes: 2 additions & 2 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.5.33",
"private": true,
"scripts": {
"prebuild": "pnpm --filter @yorkie-ui/components build",
"prebuild": "pnpm --filter @yorkie-ui/core build",
"dev": "next dev",
"build": "next build",
"start": "next start",
Expand All @@ -15,7 +15,7 @@
"next": "14.2.5"
},
"devDependencies": {
"@yorkie-ui/components": "workspace:^",
"@yorkie-ui/core": "workspace:^",
"typescript": "^5",
"@types/node": "^20",
"@types/react": "^18",
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Metadata } from 'next';
import { Inter } from 'next/font/google';
import '@yorkie-ui/components/dist/styles.css';
import '@yorkie-ui/core/dist/styles.css';

const inter = Inter({ subsets: ['latin'] });

Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { Button } from '@yorkie-ui/components';
import { Button } from '@yorkie-ui/core';

export default function Home() {
return (
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@yorkie-ui/components",
"name": "@yorkie-ui/core",
"version": "0.5.33",
"type": "module",
"main": "./src/index.ts",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading