Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/build-static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI

on:
release:
types: [created]
push:
branches: [ "main", "dev-ohos-static" ]
schedule:
- cron: '0 17 * * *'

permissions: write-all

jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: set Node.js branch or tag name
run: |
if [ "${{ github.event_name }}" == "release" ]; then
echo "VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
else
echo "VERSION=main" >> $GITHUB_ENV
fi
- name: build
run: ./build.sh ${{ env.VERSION }}
- name: upload artifact
uses: actions/upload-artifact@v4
with:
path: "./node/node-${{ env.VERSION }}-openharmony-arm64.tar.gz"
compression-level: 0
retention-days: 7
- name: upload release asset
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: "./node/node-${{ env.VERSION }}-openharmony-arm64.tar.gz"
asset_name: "node-${{ env.VERSION }}-openharmony-arm64.tar.gz"
asset_content_type: application/octet-stream
3 changes: 2 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@ if echo " $need_no_error_versions " | grep -q " $version "; then
fi
export CC_host="gcc"
export CXX_host="g++"
./configure --dest-cpu=arm64 --dest-os=openharmony --cross-compiling --prefix=node-${version}-openharmony-arm64
./configure --dest-cpu=arm64 --dest-os=openharmony --cross-compiling --prefix=node-${version}-openharmony-arm64 --fully-static --enable-static
make -j$(nproc)
make install


# code signing
/opt/ohos-sdk/linux/toolchains/lib/binary-sign-tool sign \
-inFile node-${version}-openharmony-arm64/bin/node \
Expand Down