From d889111b49d36444a1d4b97fc0769480de6f85a7 Mon Sep 17 00:00:00 2001 From: Samsam Ahmadi Date: Fri, 19 Mar 2021 21:51:28 +0330 Subject: [PATCH] build: fix release and build --- .github/templates/release.md | 2 +- .github/workflows/publish.yml | 30 ++++++++---------------------- .github/workflows/storybook.yml | 8 ++++++-- package.json | 4 ++-- 4 files changed, 17 insertions(+), 27 deletions(-) diff --git a/.github/templates/release.md b/.github/templates/release.md index b482aba..b18e8e1 100644 --- a/.github/templates/release.md +++ b/.github/templates/release.md @@ -1,3 +1,3 @@ ### Changes -$CHANGES +$CHANGES \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8a0f830..3b89a84 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,37 +3,23 @@ on: push: tags: - 'v*.*.*' + jobs: release: + name: Release runs-on: ubuntu-latest steps: - name: Checkout Repository uses: actions/checkout@v2 + - name: Get Latest Tag + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - name: Create Release uses: ntltd/release-generator@master with: - baseTag: ${{ github.event.release.tag_name }} - releaseTag: ${{ github.event.release.tag_name }} + baseTag: ${{ steps.bump_version.outputs.previous_tag }} + releaseTag: ${{ env.RELEASE_VERSION }} prerelease: false draft: false - releaseName: ${{ github.event.release.tag_name }} + releaseName: ${{ env.RELEASE_VERSION }} templatePath: templates/release.md - token: ${{ github.token }} - build: - runs-on: ubuntu-latest - steps: - - name: Checkout Repository - uses: actions/checkout@v2 - - name: Setup Node - uses: actions/setup-node@v1 - with: - node-version: 14 - registry-url: https://registry.npmjs.org/ - - name: Install and Build 🔧 - run: | - npm install - npm run build - - name: Deploy 🚀 - run: npm publish --access public - env: - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} \ No newline at end of file + token: ${{ github.token }} \ No newline at end of file diff --git a/.github/workflows/storybook.yml b/.github/workflows/storybook.yml index a68b40c..97aecb2 100644 --- a/.github/workflows/storybook.yml +++ b/.github/workflows/storybook.yml @@ -15,5 +15,9 @@ jobs: npm install npm run build-storybook - name: Deploy 🚀 - run: | - npm run deploy \ No newline at end of file + uses: crazy-max/ghaction-github-pages@v2 + with: + target_branch: gh-pages + build_dir: docs-build + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/package.json b/package.json index cc8a50b..e8cdd1f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-trip-date", - "version": "1.1.0", + "version": "1.1.1", "description": "date-picker and range-picker for React applications", "author": "Samsam Ahmadi", "license": "GPL-3.0", @@ -48,7 +48,7 @@ "sort:check": "import-sort -l 'src/**/*.{ts,tsx,js,jsx}'", "storybook": "start-storybook -p 9009", "deploy": "gh-pages -d storybook-static", - "build-storybook": "build-storybook -c .storybook -o storybook-static" + "build-storybook": "build-storybook -c .storybook -o docs-build" }, "eslintConfig": { "extends": [