Skip to content

Commit

Permalink
CI: Add package publication to workflow (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mintoo200 authored Mar 20, 2024
2 parents 6be5739 + 8a60098 commit baee2d9
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 7 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,28 @@ jobs:
uses: actions/deploy-pages@v4
with:
artifact_name: "storybook-latest"
publish-package:
needs: build
permissions:
packages: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
# TODO: add version to a .nvmrc or at least a variable
node-version: 18.12.1
cache: npm
registry-url: 'https://npm.pkg.github.com'
- name: Install
run: npm ci --omit=dev --prefer-offline
- name: Download dist
uses: actions/download-artifact@v4
with:
name: "lib-latest"
path: "./dist"
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ coverage

*storybook.log
storybook-static

.npmrc
34 changes: 34 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
.DS_Store
dist-ssr
coverage
*.local

/cypress/videos/
/cypress/screenshots/

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

*.tsbuildinfo

*storybook.log
storybook-static

.npmrc
14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
{
"name": "design-system-marque-blanche",
"name": "@octo-technology/dsocto",
"version": "1.0.0",
"main": "./dist/design-system-marque-blanche.cjs",
"module": "./dist/design-system-marque-blanche.js",
"main": "./dist/dsocto.cjs",
"module": "./dist/dsocto.js",
"exports": {
".": {
"import": "./dist/design-system-marque-blanche.js",
"require": "./dist/design-system-marque-blanche.cjs"
"import": "./dist/dsocto.js",
"require": "./dist/dsocto.cjs"
}
},
"publishConfig": {
"registry": "https://npm.pkg.github.com"
},
"repository": "https://github.com/octo-technology/Design-System---Marque-Blanche.git",
"type": "module",
"scripts": {
"build": "vite build",
Expand Down
4 changes: 2 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export default defineConfig({
build: {
lib: {
entry: resolve(__dirname, 'src/main.ts'),
name: 'design-system-marque-blanche',
fileName: 'design-system-marque-blanche'
name: 'dsocto',
fileName: 'dsocto'
},
rollupOptions: {
// make sure to externalize deps that shouldn't be bundled
Expand Down

0 comments on commit baee2d9

Please sign in to comment.