Skip to content

Commit 09296fe

Browse files
authored
chore: update publish-release workflow to use build-test script and remove release script (#31)
1 parent 8280569 commit 09296fe

File tree

4 files changed

+38
-54
lines changed

4 files changed

+38
-54
lines changed

.github/workflows/publish-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ jobs:
2828
node-version: 22
2929

3030
- run: "yarn install"
31-
- run: "./etc/scripts/workflows/release.ts"
31+
- run: "./etc/scripts/workflows/build-test.ts"
3232

3333
- name: Upload extensions to GitHub Release
3434
uses: svenstaro/upload-release-action@v2
3535
with:
3636
repo_token: ${{ secrets.GITHUB_TOKEN }}
37-
file: target/release/m*.tar.gz
37+
file: target/release/*
3838
file_glob: true
3939
tag: ${{ github.ref }}
4040
overwrite: true

etc/scripts/actions/build.ts

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,29 @@ await fse.emptyDir(workDirs.target.path);
1616
await fse.emptyDir(workDirs.target.release.path);
1717

1818
// Find all built apps and process them
19-
const buildDirs = await glob(["apps/*/target"], { onlyFiles: false });
20-
21-
await Promise.all(buildDirs.map(async (buildDir) => {
22-
const appName = buildDir.split("/")[1];
23-
const targetPath = path.join(workDirs.target.apps.path, appName);
24-
const tarPath = path.join(workDirs.target.release.path, `${appName}.tar.gz`);
25-
26-
// Copy build artifacts
27-
await fse.copy(buildDir, targetPath);
28-
console.log(`Copied ${buildDir} to ${targetPath}`);
29-
30-
// Create tar.gz archive
31-
await $`tar -czf ${tarPath} -C ${workDirs.target.apps.path} ${appName}`;
32-
console.log(`Created tar.gz: ${tarPath}`);
33-
}));
19+
const targetDirs = await glob(["apps/*/target"], { onlyFiles: false });
20+
21+
await Promise.all(
22+
targetDirs.map(async (buildDir) => {
23+
const appName = buildDir.split("/")[1];
24+
const targetPath = path.join(workDirs.target.apps.path, appName);
25+
26+
// Copy build artifacts
27+
await fse.copy(buildDir, targetPath);
28+
console.log(`Copied ${buildDir} to ${targetPath}`);
29+
}),
30+
);
31+
32+
const extensionZips = await glob(["target/apps/**/extension/dist/*.zip"]);
33+
34+
await Promise.all(
35+
extensionZips.map(async (zipPath) => {
36+
const targetZipPath = path.join(
37+
workDirs.target.release.path,
38+
path.basename(zipPath),
39+
);
40+
41+
await fse.copy(zipPath, targetZipPath);
42+
console.log(`Copied extension zip: ${targetZipPath}`);
43+
}),
44+
);

etc/scripts/workflows/build-test.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
#!/usr/bin/env -S yarn dlx tsx
22
import "zx/globals";
33
import { workDirs } from "../utils/work-dirs";
4+
import fse from "fs-extra";
45

56
$.verbose = true;
67

8+
await fse.emptyDir(workDirs.target.release.path);
9+
710
cd(workDirs.etc.workflowRuntime.path);
811

912
await $`${[
@@ -19,9 +22,13 @@ await $`${[
1922
"dev",
2023
"with-action",
2124
"--action",
22-
"build",
25+
"test",
2326
"with-action",
2427
"--action",
25-
"test",
26-
"stdout",
28+
"build",
29+
"container",
30+
"directory",
31+
`--path=${workDirs.target.release.relativePath}`,
32+
"export",
33+
`--path=${workDirs.target.release.path}`,
2734
]}`;

etc/scripts/workflows/release.ts

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)