-
Notifications
You must be signed in to change notification settings - Fork 60
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
1 parent
9b14c5b
commit 872cb4d
Showing
144 changed files
with
671 additions
and
387 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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: "Setup and build the repo" | ||
description: "A task to reuse setup steps during multiple jobs" | ||
inputs: | ||
node: | ||
description: Node version | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{inputs.node}} | ||
check-latest: true | ||
cache: yarn | ||
|
||
- name: Node.js version | ||
id: node | ||
shell: bash | ||
run: echo "v8CppApiVersion=$(node --print "process.versions.modules")" >> $GITHUB_OUTPUT | ||
|
||
- name: Restore build | ||
uses: actions/cache/restore@v4 | ||
id: cache-build-restore | ||
with: | ||
path: | | ||
node_modules | ||
packages/*/node_modules | ||
lib/ | ||
packages/*/lib | ||
packages/*/.git-data.json | ||
key: ${{ runner.os }}-${{ runner.arch }}-node-${{ inputs.node }}-${{ github.sha }} | ||
|
||
- name: Install & build | ||
if: steps.cache-build-restore.outputs.cache-hit != 'true' | ||
shell: bash | ||
run: yarn install --frozen-lockfile && yarn build | ||
|
||
- name: Build | ||
if: steps.cache-build-restore.outputs.cache-hit == 'true' | ||
shell: bash | ||
run: yarn build | ||
|
||
- name: Check Build | ||
shell: bash | ||
run: yarn check-build | ||
|
||
- name: Cache build artifacts | ||
uses: actions/cache@master | ||
with: | ||
path: | | ||
node_modules | ||
packages/*/node_modules | ||
lib/ | ||
packages/*/lib | ||
packages/*/.git-data.json | ||
key: ${{ runner.os }}-${{ runner.arch }}-node-${{ inputs.node }}-${{ github.sha }} |
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,56 @@ | ||
name: Build binaries | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
required: true | ||
type: string | ||
workflow_call: | ||
inputs: | ||
version: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
binaries: | ||
name: Build skandha binaries | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
platform: linux | ||
arch: amd64 | ||
- os: skandha-arm64-runner | ||
platform: linux | ||
arch: arm64 | ||
runs-on: ${{matrix.os}} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install arm64 specifics | ||
run: |- | ||
# Install missing yarn | ||
# See https://github.com/github-early-access/arm-runners-beta/issues/5 | ||
curl -fsSL --create-dirs -o $HOME/bin/yarn \ | ||
https://github.com/yarnpkg/yarn/releases/download/v1.22.22/yarn-1.22.22.js | ||
chmod +x $HOME/bin/yarn | ||
echo "$HOME/bin" >> $GITHUB_PATH | ||
# Install missing build-essential | ||
sudo apt-get update | ||
sudo apt-get install -y build-essential | ||
- uses: "./.github/actions/setup-and-build" | ||
with: | ||
node: 20 | ||
- run: | | ||
mkdir -p dist | ||
yarn global add [email protected] | ||
npx caxa -m "Unpacking skandha binary, please wait..." -D -p "yarn install --frozen-lockfile --production" --input . --output "skandha" -- "{{caxa}}/node_modules/.bin/node" "--max-old-space-size=8192" "{{caxa}}/node_modules/.bin/skandha" | ||
tar -czf "dist/skandha-${{ inputs.version }}-${{ matrix.platform }}-${{ matrix.arch }}.tar.gz" "skandha" | ||
- name: Upload binaries | ||
if: ${{ !github.event.act }} # skip during local actions testing | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: binaries-${{ matrix.os }} | ||
path: dist/ | ||
if-no-files-found: error |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Our current release strategy does not gurantee that the tagged commit | ||
# has the same version in the package.json. | ||
# | ||
# If that's not the case, no version will be published to NPM and a faulty image will be published to dockerhub | ||
|
||
LOCAL_VERSION=$(jq -r .version lerna.json) | ||
|
||
if [ -z "$TAG" ]; then | ||
echo "ENV TAG is empty" | ||
exit 1 | ||
fi | ||
|
||
if [[ $TAG == *"$LOCAL_VERSION"* ]]; then | ||
echo "TAG $TAG includes LOCAL_VERSION $LOCAL_VERSION" | ||
exit 0 | ||
else | ||
echo "TAG $TAG does not include LOCAL_VERSION $LOCAL_VERSION" | ||
exit 1 | ||
fi |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"act": true, | ||
"ref": "refs/tags/1.5.6" | ||
} |
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
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
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
Oops, something went wrong.