Skip to content

Merge pull request #1605 from VisActor/docs/generate-changelog-v0.21.1 #393

Merge pull request #1605 from VisActor/docs/generate-changelog-v0.21.1

Merge pull request #1605 from VisActor/docs/generate-changelog-v0.21.1 #393

Workflow file for this run

name: Pre-release CI
on:
push:
branches:
- 'pre-release/[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+'
- 'pre-release/[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+'
- 'pre-release/[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+'
jobs:
build:
runs-on: macOS-13 # 如果用了electron,记得改成 macOS-latest
permissions:
contents: 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
- 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/vrender
semver_string: ${{ github.ref_name }}
semver_pattern: '^pre-release/(.*)$' # ^v?(.*)$ by default
- name: Apply prereleaseName
run: node common/scripts/apply-prerelease-version.js ${{ steps.semver_parser.outputs.pre_release_name }} ${{ steps.semver_parser.outputs.main }}
- name: Build packages
run: node common/scripts/install-run-rush.js build --only tag:package
- 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 ${{ steps.semver_parser.outputs.pre_release_type }}
- 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/vrender
- name: Commit & Push changes
uses: actions-js/push@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
message: 'build: prelease version ${{ steps.package-version.outputs.current_version }}'
branch: ${{ github.ref_name }}
author_name: ${{ github.actor }}