Skip to content

v2.3.1

v2.3.1 #12

Workflow file for this run

name: Release
on:
release:
types: [published]
jobs:
publish-npm:
if: '!github.event.release.prerelease'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Update package version
run: |
yarn workspace @zent/compat version --no-git-tag-version --new-version ${{ github.event.release.tag_name }}
- run: yarn --frozen-lockfile
- run: yarn workspace @zent/compat build
- run: yarn workspace @zent/compat publish --non-interactive
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
prepublish-npm:
if: 'github.event.release.prerelease'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Update package version
run: |
yarn workspace @zent/compat version --no-git-tag-version --new-version ${{ github.event.release.tag_name }}
- run: yarn --frozen-lockfile
- run: yarn workspace @zent/compat build
- run: yarn workspace @zent/compat publish --non-interactive --tag=beta
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
deploy-doc:
if: '!github.event.release.prerelease'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn --frozen-lockfile
- run: yarn workspace zent-docs build
- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site/dist
- name: Sync gh-pages to gitee
uses: zent-contrib/sync-git-branch@v1
env:
# Public key is stored in @youzan-fe-bot on Github
# The reason to use a machine user account is we need access to
# multiple respositories, e.g. zent, zent-v8.
SSH_PRIVATE_KEY: ${{ secrets.GITEE_SSH_PRIVATE_KEY }}
with:
source-branch: gh-pages
destination-repo: git@gitee.com:zent-contrib/zent-compat.git
- name: Build gitee pages
uses: yanglbme/gitee-pages-action@main
with:
gitee-username: ${{ secrets.GITEE_USERNAME }}
gitee-password: ${{ secrets.GITEE_PASSWORD }}
gitee-repo: zent-contrib/zent-compat
branch: gh-pages