Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Auto release] release 0.14.8 #460

Merged
merged 27 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6a9dd40
chore: update the release and pre-release scripts and workflow
xile611 Aug 31, 2023
6f12d06
chore: fix the pre-release script of vrender
xile611 Aug 31, 2023
9530d2a
Merge pull request #419 from VisActor/sync_0.14.7
neuqzxy Aug 31, 2023
b2c3b6b
chore: fix parse-version and add some logs
xile611 Sep 1, 2023
c6443f1
chore: update current version in version-policies.json
xile611 Sep 1, 2023
376ca9f
feat: line support closePath attribute as another definition of linea…
neuqzxy Sep 1, 2023
27e2df4
fix: increase the robustness of segments, closed #424
neuqzxy Sep 1, 2023
bf11f2c
chore: fix type error in file names
xile611 Sep 4, 2023
d0955cc
feat: pie label line support smooth line
pairone Sep 4, 2023
2d2d759
Merge pull request #425 from VisActor/feat/closePath-line
neuqzxy Sep 4, 2023
eeae296
chore: merge develop
neuqzxy Sep 5, 2023
f9eeacf
feat: add scaleCenter
neuqzxy Sep 6, 2023
175c7a1
fix: modify radiusRatio according maxRadius when radius are different
pairone Sep 6, 2023
e726162
Merge branch 'develop' into fix/rose-label-related-to-arcMark-order
pairone Sep 6, 2023
f289121
chore: add rush change log
pairone Sep 6, 2023
58e11cc
feat: poptip support formatMethod
neuqzxy Sep 4, 2023
eada422
fix: fix the issue with poptip defaultAttributes
neuqzxy Sep 5, 2023
967ad55
Merge pull request #456 from VisActor/feat/poptip-sync
neuqzxy Sep 7, 2023
37b77c1
Merge pull request #452 from VisActor/feat/scale-center
neuqzxy Sep 7, 2023
76c532e
Merge branch 'develop' into fix/rose-label-related-to-arcMark-order
pairone Sep 7, 2023
37a0e6e
feat: separate the smooth line related code which will be put in the …
pairone Sep 7, 2023
7e4677d
Merge branch 'develop' into chore/release-scripts
neuqzxy Sep 7, 2023
0b86c6f
Merge pull request #410 from VisActor/chore/release-scripts
neuqzxy Sep 7, 2023
21379b1
Merge pull request #453 from VisActor/fix/rose-label-related-to-arcMa…
neuqzxy Sep 7, 2023
92f5270
Merge pull request #422 from VisActor/fix/line-segments
neuqzxy Sep 7, 2023
7b246d2
chore: rename vgrammar to vrender
neuqzxy Sep 7, 2023
4c891b2
build: prelease version 0.14.8
github-actions[bot] Sep 7, 2023
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
8 changes: 4 additions & 4 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ jobs:

- name: Parse semver version from branch name
id: semver_parser
uses: xile611/read-package-version-action@v2.1
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/install-run-rush.js publish --apply --prerelease-name ${{ steps.semver_parser.outputs.pre_release_name }} --partial-prerelease
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
Expand All @@ -57,7 +57,7 @@ jobs:

- name: Get npm version
id: package-version
uses: xile611/read-package-version-action@v2.1
uses: xile611/read-package-version-action@main
with:
path: packages/vrender

Expand All @@ -67,4 +67,4 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
message: 'build: prelease version ${{ steps.package-version.outputs.current_version }}'
branch: ${{ github.ref_name }}
author_name: ${{ github.actor }}
author_name: ${{ github.actor }}
14 changes: 14 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,20 @@ jobs:
- 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: '^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

Expand Down
14 changes: 7 additions & 7 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

106 changes: 6 additions & 100 deletions common/config/rush/version-policies.json
Original file line number Diff line number Diff line change
@@ -1,102 +1,8 @@
/**
* This is configuration file is used for advanced publishing configurations with Rush.
* More documentation is available on the Rush website: https://rushjs.io
*/

/**
* A list of version policy definitions. A "version policy" is a custom package versioning
* strategy that affects "rush change", "rush version", and "rush publish". The strategy applies
* to a set of projects that are specified using the "versionPolicyName" field in rush.json.
*/
[
// {
// /**
// * (Required) Indicates the kind of version policy being defined ("lockStepVersion" or "individualVersion").
// *
// * The "lockStepVersion" mode specifies that the projects will use "lock-step versioning". This
// * strategy is appropriate for a set of packages that act as selectable components of a
// * unified product. The entire set of packages are always published together, and always share
// * the same NPM version number. When the packages depend on other packages in the set, the
// * SemVer range is usually restricted to a single version.
// */
// "definitionName": "lockStepVersion",
//
// /**
// * (Required) The name that will be used for the "versionPolicyName" field in rush.json.
// * This name is also used command-line parameters such as "--version-policy"
// * and "--to-version-policy".
// */
// "policyName": "MyBigFramework",
//
// /**
// * (Required) The current version. All packages belonging to the set should have this version
// * in the current branch. When bumping versions, Rush uses this to determine the next version.
// * (The "version" field in package.json is NOT considered.)
// */
// "version": "1.0.0",
//
// /**
// * (Required) The type of bump that will be performed when publishing the next release.
// * When creating a release branch in Git, this field should be updated according to the
// * type of release.
// *
// * Valid values are: "prerelease", "release", "minor", "patch", "major"
// */
// "nextBump": "prerelease",
//
// /**
// * (Optional) If specified, all packages in the set share a common CHANGELOG.md file.
// * This file is stored with the specified "main" project, which must be a member of the set.
// *
// * If this field is omitted, then a separate CHANGELOG.md file will be maintained for each
// * package in the set.
// */
// "mainProject": "my-app",
//
// /**
// * (Optional) If enabled, the "rush change" command will prompt the user for their email address
// * and include it in the JSON change files. If an organization maintains multiple repos, tracking
// * this contact information may be useful for a service that automatically upgrades packages and
// * needs to notify engineers whose change may be responsible for a downstream build break. It might
// * also be useful for crediting contributors. Rush itself does not do anything with the collected
// * email addresses. The default value is "false".
// */
// // "includeEmailInChangeFile": true
// },
//
// {
// /**
// * (Required) Indicates the kind of version policy being defined ("lockStepVersion" or "individualVersion").
// *
// * The "individualVersion" mode specifies that the projects will use "individual versioning".
// * This is the typical NPM model where each package has an independent version number
// * and CHANGELOG.md file. Although a single CI definition is responsible for publishing the
// * packages, they otherwise don't have any special relationship. The version bumping will
// * depend on how developers answer the "rush change" questions for each package that
// * is changed.
// */
// "definitionName": "individualVersion",
//
// "policyName": "MyRandomLibraries",
//
// /**
// * (Optional) This can be used to enforce that all packages in the set must share a common
// * major version number, e.g. because they are from the same major release branch.
// * It can also be used to discourage people from accidentally making "MAJOR" SemVer changes
// * inappropriately. The minor/patch version parts will be bumped independently according
// * to the types of changes made to each project, according to the "rush change" command.
// */
// "lockedMajor": 3,
//
// /**
// * (Optional) When publishing is managed by Rush, by default the "rush change" command will
// * request changes for any projects that are modified by a pull request. These change entries
// * will produce a CHANGELOG.md file. If you author your CHANGELOG.md manually or announce updates
// * in some other way, set "exemptFromRushChange" to true to tell "rush change" to ignore the projects
// * belonging to this version policy.
// */
// "exemptFromRushChange": false,
//
// // "includeEmailInChangeFile": true
// }
{
"definitionName": "lockStepVersion",
"policyName": "vrenderMain",
"version": "0.14.8",
"nextBump": "patch"
}
]
14 changes: 14 additions & 0 deletions common/scripts/apply-prerelease-version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const writePrereleaseVersion = require('./set-prerelease-version');
const checkAndUpdateNextBump = require('./version-policies');


function run() {
const preReleaseName = process.argv.slice(2)[0];
const nextBump = checkAndUpdateNextBump(process.argv.slice(2)[1]);

console.log('[apply prerelease version]: ', preReleaseName, nextBump);

writePrereleaseVersion(nextBump, preReleaseName);
}

run()
8 changes: 8 additions & 0 deletions common/scripts/get-package-json.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const fs = require('fs')

function getPackageJson(pkgJsonPath) {
const pkgJson = fs.readFileSync(pkgJsonPath, { encoding: 'utf-8' })
return JSON.parse(pkgJson);
}

module.exports = getPackageJson;
31 changes: 13 additions & 18 deletions common/scripts/parse-version.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
// see more about the regex here: https://semver.org/lang/zh-CN/
// reg test: https://regex101.com/r/vkijKf/1/
const SEMVER_REG = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/gm;

function parseVersion() {
const branchName = process.argv.slice(2)[0];
function parseVersion(version) {
const res = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/gm.exec(version);


if (branchName) {
const versionName = branchName.includes('release/') ? branchName.replace('release/', '') : branchName;
const res = SEMVER_REG.exec(versionName);

if (res) {
return {
major: res[1],
minor: res[2],
patch: res[3],
preReleaseName: res[4],
preReleaseType: res[4].includes('.') ? res[4].split('.')[0] : res[4]
};
}
if (res) {
return {
major: +res[1],
minor: +res[2],
patch: +res[3],
preReleaseName: res[4],
preReleaseType: res[4] && res[4].includes('.') ? res[4].split('.')[0] : res[4]
};
}

return null;
}
}

module.exports = parseVersion
29 changes: 12 additions & 17 deletions common/scripts/pre-release.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
/**
* prelease
* node release.js [alpha.0] [patch | major | minor | 1.0.0]
*/

const { spawnSync } = require('child_process')
const fs = require('fs')
const path = require('path')
const checkAndUpdateNextBump = require('./version-policies');
const getPackageJson = require('./get-package-json');
const writePrereleaseVersion = require('./set-prerelease-version');

function getPackageJson(pkgJsonPath) {
const pkgJson = fs.readFileSync(pkgJsonPath, { encoding: 'utf-8' })
return JSON.parse(pkgJson);
}

const semverRegex = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-(alpha|beta|rc)(?:\.(?:(0|[1-9])))*)$/;

const preReleaseNameReg = /^((alpha|beta|rc)(?:\.(?:0|[1-9]))*)$/;


function run() {
let preReleaseName = process.argv.slice(2)[0];
let preReleaseType = '';
const cwd = process.cwd();
const rushJson = getPackageJson(`${cwd}/rush.json`)
const rushJson = getPackageJson(path.join(__dirname, '../../rush.json'))
const package = rushJson.projects.find((project) => project.packageName === '@visactor/vrender');
let regRes = null;


if (typeof preReleaseName === 'string' && preReleaseName && (regRes = preReleaseNameReg.exec(preReleaseName))) {
preReleaseType = regRes[2];
} else if (!preReleaseName) {
if (package) {
const pkgJsonPath = path.resolve(package.projectFolder, 'package.json')
const pkgJsonPath = path.join(__dirname, '../../', package.projectFolder, 'package.json')
const pkgJson = getPackageJson(pkgJsonPath)
const currentVersion = pkgJson.version;

Expand All @@ -54,20 +54,14 @@ function run() {

if (preReleaseName && preReleaseType) {
// 1. apply version and update version of package.json
spawnSync('sh', ['-c', `rush publish --apply --prerelease-name ${preReleaseName} --partial-prerelease`], {
stdio: 'inherit',
shell: false,
});


writePrereleaseVersion(checkAndUpdateNextBump(process.argv.slice(2)[1]), preReleaseName)

// 2. build all the packages
spawnSync('sh', ['-c', `rush build --only tag:package`], {
stdio: 'inherit',
shell: false,
});



// 3. publish to npm
spawnSync('sh', ['-c', `rush publish --publish --include-all --tag ${preReleaseType}`], {
stdio: 'inherit',
Expand All @@ -81,7 +75,7 @@ function run() {
});

if (package) {
const pkgJsonPath = path.resolve(package.projectFolder, 'package.json')
const pkgJsonPath = path.join(__dirname, '../../', package.projectFolder, 'package.json');
const pkgJson = getPackageJson(pkgJsonPath)

// 5. add the the changes
Expand All @@ -100,3 +94,4 @@ function run() {
}

run()

Loading