Skip to content

Merge pull request #198 from VisActor/fix/external-build #38

Merge pull request #198 from VisActor/fix/external-build

Merge pull request #198 from VisActor/fix/external-build #38

Workflow file for this run

name: Release CI
on:
push:
branches:
- 'release/[0-9]+.[0-9]+.[0-9]+'
jobs:
build:
runs-on: macOS-13 # 如果用了electron,记得改成 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'
- name: Print All Github Environment Variables
run:
env
# Install rush
- name: Install rush
run: node common/scripts/install-run-rush.js update --bypass-policy
- name: Parse semver version from branch name
id: semver_parser
uses: xile611/read-package-version-action@main
with:
path: packages/vstory
semver_string: ${{ github.ref_name }}
semver_pattern: '^release/(.*)$' # ^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: Update version
run: node common/scripts/install-run-rush.js version --bump
- name: Build vstory-core
run: node common/scripts/install-run-rush.js build --only @visactor/vstory-core
- name: Build vstory-templates
run: node common/scripts/install-run-rush.js build --only @visactor/vstory-templates
- name: Build vstory-editor
run: node common/scripts/install-run-rush.js build --only @visactor/vstory-editor
- name: Build vstory-animate
run: node common/scripts/install-run-rush.js build --only @visactor/vstory-animate
- name: Build vstory-player
run: node common/scripts/install-run-rush.js build --only @visactor/vstory-player
- name: Build vstory-external
run: node common/scripts/install-run-rush.js build --only @visactor/vstory-external
- name: Build vstory
env:
NODE_OPTIONS: "--max_old_space_size=4096"
run: node --max-old-space-size=8192000 --max_semi_space_size=8192000 common/scripts/install-run-rush.js build --only @visactor/vstory
- name: Build bugserver
run: node common/scripts/install-run-rush.js build --only @internal/bugserver-trigger
# - name: Run CI
# working-directory: ./tools/bugserver-trigger
# env:
# BUG_SERVER_TOKEN: ${{ secrets.BUG_SERVER_TOKEN }}
# run: node ../../common/scripts/install-run-rushx.js ci -t @internal/bugserver-trigger
- 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
- name: Update shrinkwrap
run: node common/scripts/install-run-rush.js update
- name: Get npm version
id: package-version
uses: xile611/[email protected]
with:
path: packages/vstory
- 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 }}
- 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: main
prerelease: false
body: |
${{ steps.changelog.outputs.markdown }}
draft: true #
- name: Create Pull Request
uses: dustinirving/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: '[Auto release] release ${{ steps.package-version.outputs.current_version }}'
base: main
head: ${{ github.ref_name }}
labels: release # default labels, the action will throw error if not specified
reviewers: xile611 # default reviewers, the action will throw error if not specified
body: |
${{ steps.changelog.outputs.markdown }}