chore: fix release scripts #13
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: hotfix release CI | |
on: | |
push: | |
branches: | |
- 'hotfix/[0-9]+.[0-9]+.[0-9]+' | |
jobs: | |
build: | |
runs-on: macOS-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
strategy: | |
matrix: | |
node-version: [18.x] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- uses: actions/checkout@v3 | |
- run: | | |
git config user.name ${{ github.actor }} | |
git config user.email ${{ github.actor }}@users.noreply.github.com | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
cache-dependency-path: './common/config/rush/pnpm-lock.yaml' | |
# Install rush | |
- name: Install rush | |
run: node common/scripts/install-run-rush.js install --bypass-policy | |
- name: Parse semver version from branch name | |
id: semver_parser | |
uses: xile611/read-package-version-action@main | |
with: | |
path: packages/vchart | |
semver_string: ${{ github.ref_name }} | |
semver_pattern: '^hotfix/(.*)$' # ^v?(.*)$ by default | |
- name: update nextBump of version policies | |
uses: xile611/set-next-bump-of-rush@main | |
with: | |
release_version: ${{ steps.semver_parser.outputs.full }} | |
write_next_bump: true | |
- name: Generate changelog by rush version | |
run: node common/scripts/install-run-rush.js version --bump | |
- name: Update version | |
run: node common/scripts/apply-release-version.js 'none' ${{ steps.semver_parser.outputs.main }} | |
- name: Build vutils-extension && vchart | |
env: | |
NODE_OPTIONS: '--max_old_space_size=4096' | |
run: node common/scripts/install-run-rush.js build --to @visactor/vchart | |
- name: Build react-vchart | |
env: | |
NODE_OPTIONS: '--max_old_space_size=4096' | |
run: node common/scripts/install-run-rush.js build --only @visactor/react-vchart | |
- name: Build taro-vchart | |
env: | |
NODE_OPTIONS: '--max_old_space_size=4096' | |
run: node common/scripts/install-run-rush.js build --only @visactor/taro-vchart | |
- name: Build lark-vchart | |
env: | |
NODE_OPTIONS: '--max_old_space_size=4096' | |
run: node common/scripts/install-run-rush.js build --only @visactor/lark-vchart | |
- name: Build wx-vchart | |
env: | |
NODE_OPTIONS: '--max_old_space_size=4096' | |
run: node common/scripts/install-run-rush.js build --only @visactor/wx-vchart | |
- name: Publish to npm | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
NPM_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
run: node common/scripts/install-run-rush.js publish --publish --include-all --tag hotfix | |
- name: Update shrinkwrap | |
run: node common/scripts/install-run-rush.js update | |
- name: Get npm version | |
id: package-version | |
uses: xile611/read-package-version-action@main | |
with: | |
path: packages/vchart | |
- name: Commit & Push changes | |
run: | | |
git add . | |
git commit -m 'build: prelease version ${{ steps.package-version.outputs.current_version }}' -n | |
git push origin ${{ github.ref_name }} | |
- name: Collect changelog of rush | |
uses: xile611/collect-rush-changlog@main | |
id: changelog | |
with: | |
version: ${{ steps.package-version.outputs.current_version }} | |
- name: Create Release for Tag | |
id: release_tag | |
uses: ncipollo/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag: v${{ steps.package-version.outputs.current_version }} | |
commit: ${{ github.ref_name }} | |
prerelease: false | |
body: | | |
${{ steps.changelog.outputs.markdown }} | |
draft: true # |