Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 37 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,27 +52,47 @@ jobs:
- name: Update version
run: node common/scripts/install-run-rush.js version --bump

- name: Update version (release)
if: startsWith(github.ref_name, 'release/')
run: node common/scripts/apply-release-version.js 'none' ${{ steps.semver_release.outputs.main }}

- name: Build packages
env:
NODE_OPTIONS: '--max_old_space_size=4096'
NO_EMIT_ON_ERROR: 'true'
run: |
export NODE_OPTIONS="--max_old_space_size=4096"
export NO_EMIT_ON_ERROR="true"
node common/scripts/install-run-rush.js build --only tag:package 2>&1 | tee build.log || {
echo "=== Build failed, showing last 1000 lines of build.log ==="
tail -n 1000 build.log
echo "=== Full error details ==="
grep -A 50 "TypeScript Compilation Errors" build.log || true
grep -A 50 "Build Error" build.log || true
exit 1
}

- 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
set -euo pipefail
package_names=()
while IFS= read -r package_name; do
[ -n "$package_name" ] && package_names+=("$package_name")
done < <(node <<'NODE'
const fs = require('fs');
const path = require('path');

const packagesDir = path.join(process.cwd(), 'packages');
const packageNames = fs
.readdirSync(packagesDir, { withFileTypes: true })
.filter((entry) => entry.isDirectory())
.map((entry) => path.join(packagesDir, entry.name, 'package.json'))
.filter((packageJsonPath) => fs.existsSync(packageJsonPath))
.map((packageJsonPath) => JSON.parse(fs.readFileSync(packageJsonPath, 'utf8')).name)
.filter(Boolean)
.sort();

console.log(packageNames.join('\n'));
NODE
)

build_args=()
for package_name in "${package_names[@]}"; do
build_args+=(--to "$package_name")
done

echo "Build packages: ${package_names[*]}"
node common/scripts/install-run-rush.js build "${build_args[@]}"

- name: Publish to npm (release)
if: startsWith(github.ref_name, 'release/')
run: node common/scripts/install-run-rush.js publish --publish --include-all --tag latest

- name: Update shrinkwrap
run: node common/scripts/install-run-rush.js update
Expand Down
11 changes: 11 additions & 0 deletions common/changes/@visactor/vtable/chore-update-release-ci.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@visactor/vtable",
"comment": "chore: update release ci",
"type": "none"
}
],
"packageName": "@visactor/vtable",
"email": "892739385@qq.com"
}
Loading