diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 43b7841..f360435 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -137,12 +137,21 @@ jobs: - name: zip storybook-static run: tar -czf storybook-static.tar.gz ./storybook-static - - name: Upload artifact + - name: Upload storybook-static artifact uses: actions/upload-artifact@v3 with: name: my_storybook-static_artifact path: storybook-static.tar.gz + - name: zip dist + run: tar -czf dist.tar.gz ./dist + + - name: Upload dist artifact + uses: actions/upload-artifact@v3 + with: + name: my_dist_artifact + path: dist.tar.gz + ################################## TEST ######################################### test: @@ -270,9 +279,9 @@ jobs: ################################## DEPLOYMENT ######################################## - publish: + publish-npm: needs: [release] - name: "Publish to Chromatic and NPM" + name: "Publish to NPM" runs-on: ubuntu-latest if: github.ref == 'refs/heads/main' environment: @@ -302,19 +311,47 @@ jobs: - name: unzip node_modules run: tar -xzf node_modules.tar.gz + - name: Load artifact dist + uses: actions/download-artifact@v3 + with: + name: my_dist_artifact + + - name: unzip dist + run: tar -xzf dist.tar.gz + - name: Set deployment token run: pnpm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}" - name: Publish to NPM run: pnpm publish --access=public --no-git-checks + publish-chromatic: + needs: [release] + name: "Publish to Chromatic" + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + environment: + name: Production + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # 👈 Required to retrieve git history + + - name: Load artifact storybook-static + uses: actions/download-artifact@v3 + with: + name: my_storybook-static_artifact + + - name: unzip storybook-static + run: tar -xzf storybook-static.tar.gz + - name: Publish to Chromatic id: chromatic uses: chromaui/action@v1 with: projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }} - buildScriptName: build + storybookBuildDir: 'storybook-static' - name: Publish Chromatic Summary run: echo -e "| Results | |\n| --- | --- |\n| Build Results | ${{steps.chromatic.outputs.buildUrl}} |\n| Storybook Preview | ${{steps.chromatic.outputs.storybookUrl}} |\n| Component Count | ${{steps.chromatic.outputs.componentCount}} |" >> $GITHUB_STEP_SUMMARY diff --git a/CHANGELOG.md b/CHANGELOG.md index 23c0676..ed4de24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.1.5] - 2023-07-27 +### Chore +* chore: update publish to chromatic and npm CI. +### Contributors to this release +* Ramzi Hannachi ([@rhannachi](https://github.com/rhannachi)) + ## [1.1.4] - 2023-07-25 ### Features * add new colors for `Icon`. diff --git a/package.json b/package.json index 68aa62a..ed2c039 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,13 @@ { "name": "@rhannachi/components", "author": "rhannachi", - "version": "1.1.4", + "version": "1.1.5", "license": "MIT", "main": "dist/index.js", "module": "dist/index.esm.js", "types": "dist/index.d.ts", - "files": [ - "dist" - ], + "files": ["dist"], + "homepage": "https://main--648f1b983076c579eab28ee1.chromatic.com", "repository": "https://github.com/rhannachi/storybook-react.git", "description": "Storybook design systems", "scripts": {