mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-11-23 16:22:21 +03:00
fix: add workflow to check release version match with package.json (#2420)
This commit is contained in:
parent
c870104370
commit
02e1f528bf
1
.github/workflows/nightly-build.yml
vendored
1
.github/workflows/nightly-build.yml
vendored
@ -66,6 +66,7 @@ jobs:
|
||||
API_SERVER_PROFILE: prod
|
||||
ENABLE_TEST_PROPERTIES: false
|
||||
ENABLE_IMAGE_PREVIEW_MODAL: false
|
||||
RELEASE_VERSION: ${{ needs.set-build-version.outputs.version }}
|
||||
|
||||
- name: Upload Artifact (web-static)
|
||||
uses: actions/upload-artifact@v3
|
||||
|
1
.github/workflows/release-desktop-app.yml
vendored
1
.github/workflows/release-desktop-app.yml
vendored
@ -67,6 +67,7 @@ jobs:
|
||||
API_SERVER_PROFILE: prod
|
||||
ENABLE_TEST_PROPERTIES: false
|
||||
ENABLE_IMAGE_PREVIEW_MODAL: false
|
||||
RELEASE_VERSION: ${{ github.event.inputs.version }}
|
||||
|
||||
- name: Upload Artifact (web-static)
|
||||
uses: actions/upload-artifact@v3
|
||||
|
@ -9,6 +9,7 @@ const publicDistDir = path.join(electronRootDir, 'resources');
|
||||
const affineWebDir = path.join(repoRootDir, 'apps', 'web');
|
||||
const affineWebOutDir = path.join(affineWebDir, 'out');
|
||||
const publicAffineOutDir = path.join(publicDistDir, `web-static`);
|
||||
const releaseVersionEnv = process.env.RELEASE_VERSION || '';
|
||||
|
||||
console.log('build with following dir', {
|
||||
repoRootDir,
|
||||
@ -19,9 +20,20 @@ console.log('build with following dir', {
|
||||
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
|
||||
|
||||
// step 0: clean up
|
||||
// step 1: clean up
|
||||
await cleanup();
|
||||
echo('Clean up done');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user