Skip to content

Commit 57fc908

Browse files
Implement matrix build for cross-platform releases (#28)
* Implement matrix build for cross-platform releases * Implement matrix build with platform-specific naming * Update scripts/release.js Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 3204458 commit 57fc908

2 files changed

Lines changed: 21 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,16 @@ on:
77

88
jobs:
99
release:
10-
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
include:
13+
- os: ubuntu-latest
14+
platform: linux
15+
- os: macos-latest
16+
platform: darwin
17+
- os: windows-latest
18+
platform: win32
19+
runs-on: ${{ matrix.os }}
1120
permissions:
1221
contents: write
1322
steps:
@@ -29,10 +38,10 @@ jobs:
2938
run: npm run build --workspace=workspace-server
3039

3140
- name: Create release assets
32-
run: npm run release
41+
run: npm run release -- --platform=${{ matrix.platform }}
3342

3443
- name: Release
3544
uses: softprops/action-gh-release@v1
3645
if: startsWith(github.ref, 'refs/tags/')
3746
with:
38-
files: release/google-workspace-extension.tar.gz
47+
files: release/${{ matrix.platform }}.google-workspace-extension.tar.gz

scripts/release.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,15 @@ const deleteFilesByExtension = (dir, ext) => {
2727
};
2828

2929
const main = async () => {
30-
const name = 'google-workspace-extension';
30+
const platform = argv.platform;
31+
if (platform && typeof platform !== 'string') {
32+
console.error(
33+
'Error: The --platform argument must be a string (e.g., --platform=linux).'
34+
);
35+
process.exit(1);
36+
}
37+
const baseName = 'google-workspace-extension';
38+
const name = platform ? `${platform}.${baseName}` : baseName;
3139
const extension = 'tar.gz';
3240

3341
const rootDir = path.join(__dirname, '..');

0 commit comments

Comments
 (0)