From adeaa36e2d9d108d0e2c138bfdd51e730753d3fc Mon Sep 17 00:00:00 2001 From: Rafael Henrique de Andrade Date: Wed, 11 Dec 2024 16:42:14 -0300 Subject: [PATCH] feat: adds actions to relase to github registry --- .github/workflows/release.action.yml | 47 ++++++++++++++++++++++++++++ package.json | 11 ++++--- 2 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/release.action.yml diff --git a/.github/workflows/release.action.yml b/.github/workflows/release.action.yml new file mode 100644 index 00000000..1c8f02b0 --- /dev/null +++ b/.github/workflows/release.action.yml @@ -0,0 +1,47 @@ +name: 'Release DS' + +on: + release: + types: [published] + +env: + NODE_VERSION: 20.x + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'npm' + - run: npm ci + - run: npm run build + - uses: actions/upload-artifact@v4 + with: + name: ds-build + path: dist/ + + publish: + needs: build + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + steps: + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: ds-build + path: dist/ + - uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + registry-url: https://npm.pkg.github.com/ + scope: '@uxshop' + cache: 'npm' + - run: npm ci + - run: ls dist/ + env: + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/package.json b/package.json index 64d63153..d45b1ef5 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,14 @@ { - "name": "design-system", - "version": "4.0.0-alpha", + "name": "@uxshop/design-system", + "version": "4.0.0-beta", "type": "module", "engines": { "node": ">=20.10.0" }, + "repository": { + "type": "git", + "url": "git+https://github.com/uxshop/design-system.git" + }, "scripts": { "dev": "vite", "preview": "vite preview --port 5050", @@ -19,8 +23,7 @@ "storybook": "storybook dev -p 6006", "storybook:build": "storybook build", "storybook:sass:compile": "tsx .storybook/compile.ts", - "prepare": "husky", - "postinstall": "npm run build" + "prepare": "husky" }, "peerDependencies": { "typescript": ">= 5.5.0",