-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
62 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,17 +26,22 @@ jobs: | |
with: | ||
python-version: '3.10' | ||
|
||
- name: Use ccache | ||
uses: hendrikmuhs/[email protected] | ||
with: | ||
key: 20241030-${{ matrix.os }} | ||
|
||
- name: Bootstrap | ||
run: npx zx bootstrap.mjs --verbose | ||
|
||
- name: Build | ||
run: npx zx build.mjs --target-arch ${{ matrix.arch }} | ||
|
||
- name: Export | ||
run: npx zx export.mjs | ||
|
||
- name: Upload | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: executorch-${{ matrix.os }}-${{ matrix.arch }} | ||
path: executorch-${{ matrix.os }}-${{ matrix.arch }}-*.zip | ||
retention-days: 1 | ||
|
||
release: | ||
if: startsWith(github.ref, 'refs/tags/') | ||
needs: [build] | ||
|
@@ -60,4 +65,4 @@ jobs: | |
draft: true | ||
name: ExecuTorch ${{ github.ref_name }} | ||
body: '## Changelog' | ||
files: '*.gz' | ||
files: '*.zip' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
*.swp | ||
*.zip | ||
|
||
/dist | ||
/out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
$.verbose = true | ||
|
||
export async function python() { | ||
try { | ||
return await which('python3') | ||
} catch { | ||
return await which('python') | ||
} | ||
export let python | ||
try { | ||
python = await which('python3') | ||
} catch { | ||
python = await which('python') | ||
} | ||
|
||
export async function torchPath() { | ||
const r = await $`${await python()} -c 'import torch as _; print(_.__path__[0])'` | ||
const r = await $`${python} -c 'import torch as _; print(_.__path__[0])'` | ||
return r.stdout.trim() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env zx | ||
|
||
import {python} from './common.mjs'; | ||
|
||
await fs.emptyDir('dist') | ||
|
||
// Copy headers. | ||
const headers = await glob([ | ||
'executorch/extension/data_loader/**/*.h', | ||
'executorch/extension/module/**/*.h', | ||
'executorch/extension/tensor/**/*.h', | ||
'executorch/runtime/**/*.h', | ||
'executorch/schema/**/*.h', | ||
]) | ||
await Promise.all(headers.map(h => fs.copy(h, `dist/include/${h}`))) | ||
|
||
// Copy static libs. | ||
const libs = await glob('out/**/*.a') | ||
await Promise.all(libs.map(l => fs.copy(l, `dist/libs/${path.basename(l)}`))) | ||
|
||
// Zip files. | ||
const [ targetArch, targetOs ] = String(await fs.readFile('out/.stamp')).split('\n') | ||
const name = `executorch-${targetOs}-${targetArch}-full` | ||
await $`${python} -c "import shutil; shutil.make_archive('${name}', 'zip', 'dist')"` | ||
await fs.remove('dist') |