mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-05 19:40:30 +08:00
fix: add workflow to check release version match with package.json (#2420)
This commit is contained in:
@@ -66,6 +66,7 @@ jobs:
|
|||||||
API_SERVER_PROFILE: prod
|
API_SERVER_PROFILE: prod
|
||||||
ENABLE_TEST_PROPERTIES: false
|
ENABLE_TEST_PROPERTIES: false
|
||||||
ENABLE_IMAGE_PREVIEW_MODAL: false
|
ENABLE_IMAGE_PREVIEW_MODAL: false
|
||||||
|
RELEASE_VERSION: ${{ needs.set-build-version.outputs.version }}
|
||||||
|
|
||||||
- name: Upload Artifact (web-static)
|
- name: Upload Artifact (web-static)
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ jobs:
|
|||||||
API_SERVER_PROFILE: prod
|
API_SERVER_PROFILE: prod
|
||||||
ENABLE_TEST_PROPERTIES: false
|
ENABLE_TEST_PROPERTIES: false
|
||||||
ENABLE_IMAGE_PREVIEW_MODAL: false
|
ENABLE_IMAGE_PREVIEW_MODAL: false
|
||||||
|
RELEASE_VERSION: ${{ github.event.inputs.version }}
|
||||||
|
|
||||||
- name: Upload Artifact (web-static)
|
- name: Upload Artifact (web-static)
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ const publicDistDir = path.join(electronRootDir, 'resources');
|
|||||||
const affineWebDir = path.join(repoRootDir, 'apps', 'web');
|
const affineWebDir = path.join(repoRootDir, 'apps', 'web');
|
||||||
const affineWebOutDir = path.join(affineWebDir, 'out');
|
const affineWebOutDir = path.join(affineWebDir, 'out');
|
||||||
const publicAffineOutDir = path.join(publicDistDir, `web-static`);
|
const publicAffineOutDir = path.join(publicDistDir, `web-static`);
|
||||||
|
const releaseVersionEnv = process.env.RELEASE_VERSION || '';
|
||||||
|
|
||||||
console.log('build with following dir', {
|
console.log('build with following dir', {
|
||||||
repoRootDir,
|
repoRootDir,
|
||||||
@@ -19,9 +20,20 @@ console.log('build with following dir', {
|
|||||||
publicAffineOutDir,
|
publicAffineOutDir,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// step 0: check version match
|
||||||
|
const electronPackageJson = await import(`${electronRootDir}/package.json`, {
|
||||||
|
assert: {
|
||||||
|
type: 'json',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (releaseVersionEnv && electronPackageJson.version !== releaseVersionEnv) {
|
||||||
|
throw new Error(
|
||||||
|
`Version mismatch, expected ${releaseVersionEnv} but got ${electronPackageJson.version}`
|
||||||
|
);
|
||||||
|
}
|
||||||
// copy web dist files to electron dist
|
// copy web dist files to electron dist
|
||||||
|
|
||||||
// step 0: clean up
|
// step 1: clean up
|
||||||
await cleanup();
|
await cleanup();
|
||||||
echo('Clean up done');
|
echo('Clean up done');
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user