v3.2.0 #955
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Release new version' | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
release: | |
# uncomment next line as soon as visual tesing starts working | |
# needs: visual_test | |
name: Release tag | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Check for release commit | |
id: 'is_release_commit' | |
uses: /innovaccer/design-system/actions/check-release-commit@master | |
- uses: actions/setup-node@v1 | |
if: steps.is_release_commit.outputs.result == 1 | |
with: | |
node-version: '20.x' | |
- name: npm install | |
if: steps.is_release_commit.outputs.result == 1 | |
run: npm ci | |
- name: test | |
if: steps.is_release_commit.outputs.result == 1 | |
run: npm run test | |
- name: Upload coverage to Codecov | |
if: steps.is_release_commit.outputs.result == 1 | |
uses: codecov/codecov-action@v1 | |
- name: setup git | |
if: steps.is_release_commit.outputs.result == 1 | |
run: git checkout -b preparing-module-for-npm-publish && git config --global user.email "release-bot@innovaccer.com" && git config --global user.name "release-bot" | |
- name: bump module version | |
if: steps.is_release_commit.outputs.result == 1 | |
run: RELEASE_COMMIT=true npm version --allow-same-version --no-commit-hooks $(git log -1 --pretty=format:%s) -m "Released %s" | |
- name: gnerate .npmrc | |
if: steps.is_release_commit.outputs.result == 1 | |
run: cp .npmrc.stub .npmrc | |
- name: Publish to npmjs | |
if: steps.is_release_commit.outputs.result == 1 | |
run: npm publish --access public | |
env: | |
NPM_TOKEN: ${{secrets.NPM_TOKEN}} | |
- name: remove .npmrc | |
if: steps.is_release_commit.outputs.result == 1 | |
run: rm -rf .npmrc | |
- name: push module tags to github | |
if: steps.is_release_commit.outputs.result == 1 | |
run: git push https://${{ secrets.GH_TOKEN }}@github.com/$GITHUB_REPOSITORY.git $(git log -2 --pretty=format:%B | tail -n1) | |
# Note : not working due to limitation of github actions to push to protected branches. | |
# Error example : remote: error: GH006: Protected branch update failed for refs/heads/docs. | |
# Please add updated version in package.json while adding the release commit itself. | |
# - name: remove css/dist dist/ from commit | |
# if: steps.is_release_commit.outputs.result == 1 | |
# run: | | |
# git reset HEAD~1 | |
# git add package.json | |
# git commit -m "Released $(git log -1 --pretty=format:%s)" --no-verify | |
# - name: push version to github | |
# if: steps.is_release_commit.outputs.result == 1 | |
# run: git push https://${{ secrets.GH_TOKEN }}@github.com/$GITHUB_REPOSITORY.git HEAD:master | |
- name: deploy storybook | |
if: steps.is_release_commit.outputs.result == 1 | |
run: npm run deploy-storybook -- --bucket-path=webui-mds-sb-prod --aws-profile=NONE --ci | |
env: | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_KEY }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_KEY_ID }} | |
AWS_REGION: ${{ secrets.DOCS_REGION }} | |
- name: notify release | |
if: steps.is_release_commit.outputs.result == 1 | |
uses: /innovaccer/design-system/actions/notify-release@master | |
env: | |
GCHAT_PATH: ${{ secrets.GCHAT_PATH }} | |
site_deploy: | |
name: Deploy docs site | |
needs: release | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./docs | |
env: | |
DOCS_BUCKET: webui-mds-docs-prod | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Check for release commit | |
id: 'is_release_commit' | |
uses: /innovaccer/design-system/actions/check-release-commit@master | |
- uses: actions/setup-node@v1 | |
if: steps.is_release_commit.outputs.result == 1 | |
with: | |
node-version: '20.x' | |
- name: npm install | |
if: steps.is_release_commit.outputs.result == 1 | |
run: npm i --force | |
- name: extract stories | |
if: steps.is_release_commit.outputs.result == 1 | |
run: npm run extract | |
env: | |
STORYBOOK_HOST: 'https://mds.innovaccer.com/iframe.html?id=components-avatar-avatargroup-all--all&args=&viewMode=story' | |
- name: build | |
if: steps.is_release_commit.outputs.result == 1 | |
run: npm run build | |
env: | |
DOCS_BUCKET: webui-mds-docs-prod | |
- name: deploy | |
if: steps.is_release_commit.outputs.result == 1 | |
run: npm run deploy && aws cloudfront create-invalidation --distribution-id ${{ secrets.DISTRIBUTION_ID }} --paths "/*" | |
env: | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_KEY }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_KEY_ID }} | |
AWS_REGION: ${{ secrets.DOCS_REGION }} | |
DOCS_BUCKET: webui-mds-docs-prod |