8000 Chore/update harmony release by xile611 · Pull Request #2813 · VisActor/VChart · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Chore/update harmony release #2813

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

Merged
merged 2 commits into from
Jun 14, 2024
Merged
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
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
- name: Commit & Push changes
run: |
git add .
git commit -m 'build: prelease version ${{ steps.package-version.outputs.current_version }}' -n
git commit -m 'build: release version ${{ steps.package-version.outputs.current_version }}' -n
git push origin ${{ github.ref_name }}

- name: Collect changelog of rush
Expand All @@ -118,6 +118,9 @@ jobs:
with:
version: ${{ steps.package-version.outputs.current_version }}

- name: Update changelog of harmony
run: node common/scripts/set-changelog-of-harmony.js ${{ steps.package-version.outputs.current_version }} ${{ steps.changelog.outputs.markdown }}

- name: Create Release for Tag
id: release_tag
uses: ncipollo/release-action@v1.12.0
Expand Down
21 changes: 21 additions & 0 deletions common/scripts/set-changelog-of-harmony.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const fs = require('fs')
const path = require('path')

function setChangelogOfHarmny() {
const nextVersion = process.argv.slice(2)[0];
const changelogContent = process.argv.slice(2)[1];
const changelogPath = path.join(__dirname, '../../packages/harmony_vchart/library/CHANGELOG.md');
let fileContent = fs.readFileSync(changelogPath, { encoding: 'utf-8' });

fileContent = `
## ${nextVersion}

${changelogContent}

${fileContent}
`;

fs.writeFileSync(fileContent, changelogPath)
}

module.exports = setChangelogOfHarmny;
13 changes: 12 additions & 1 deletion common/scripts/set-prerelease-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ const getPackageJson = require('./get-package-json');
const parseVersion = require('./parse-version');
const setJsonFileByKey = require('./set-json-file');

function writeVersionOfHarmony(nextVersion) {
const ohPackageJsonPath = path.join(__dirname, '../../packages/harmony_vchart/library/oh-package.json5');
let jsonFile = fs.readFileSync(ohPackageJsonPath, { encoding: 'utf-8' });
const pkgJson = JSON.parse(jsonFile);

jsonFile = setJsonFileByKey(jsonFile, pkgJson, ['version'], nextVersion);


fs.writeFileSync(pkgJsonPath, jsonFile);
}


function writePrereleaseVersion(nextBump, preReleaseName, nextVersionStr, buildName) {
const rushJson = getPackageJson(path.join(__dirname, '../../rush.json'));
Expand Down Expand Up @@ -86,7 +97,7 @@ function writePrereleaseVersion(nextBump, preReleaseName, nextVersionStr, buildN
fs.writeFileSync(pkgJsonPath, jsonFile)
});


writeVersionOfHarmony(nextVersion);
}

module.exports = writePrereleaseVersion;
16 changes: 11 additions & 5 deletions packages/vchart/bundler.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,17 @@ module.exports = {
umdEntries.forEach(entry => {
fs.unlinkSync(path.join(__dirname, config.outputDir.umd, `${entry}.min.js`));
});
// harmonyOS
const source = 'index.es.js';
const dest = '../harmony_vchart/library/src/main/ets/vchart_dist.js';
const envSource = path.join(__dirname, config.outputDir.umd, source);
copyFile(envSource, path.join(__dirname, dest));

try {
// harmonyOS
const source = 'es5/index.es.js';
const dest = '../harmony_vchart/library/src/main/ets/vchart_dist.js';
const envSource = path.join(__dirname, config.outputDir.umd, source);
copyFile(envSource, path.join(__dirname, dest));
fs.unlinkSync(path.join(__dirname, config.outputDir.umd, source));
} catch(e) {
console.log(`[Error] can't copy es5/index.es.js to harmony`)
}
}
}
};
Loading
0