feat: update #19
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 | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out git repository | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: '14' | |
- uses: c-hive/gha-yarn-cache@v2 | |
- run: yarn install --registry=https://registry.yarnpkg.com | |
# - name: Test | |
# run: yarn lint | |
- name: Build | |
run: yarn build:lib | |
- name: build | |
run: | | |
export GIT_COMMIT_USER_NAME=`git show -s --format=%an` | |
export GIT_COMMIT_USER_EMAIL=`git show -s --format=%ae` | |
git config user.email "${GIT_COMMIT_USER_EMAIL}" | |
git config user.name "${GIT_COMMIT_USER_NAME}" | |
export GIT_COMMIT_MESSAGE=`git show -s --format=%s` | |
export GIT_TAG="0.0.$(git rev-list --count HEAD master)0" | |
echo "TAG ->> $GIT_TAG" | |
git checkout -b build@${GIT_TAG} | |
cat package.json | jq --arg tag ${GIT_TAG} 'setpath(["version"];$tag)' > "package.json.bak" | |
mv package.json.bak package.json | |
rm -rf CHANGELOG.md | |
rm -rf CONTRIBUTING.md | |
rm -rf README.md | |
rm -rf README_ZH.md | |
rm -rf babel.config.js | |
rm -rf demos | |
rm -rf index.html | |
rm -rf node_modules | |
rm -rf postcss.config.js | |
rm -rf public | |
rm -rf src | |
rm -rf tsconfig.json | |
rm -rf vite.config.ts | |
rm -rf yarn.lock | |
git add . | |
git commit -m "${GIT_COMMIT_MESSAGE}" | |
git tag -a ${GIT_TAG} -m "${GIT_COMMIT_MESSAGE}" | |
git push --tags |