Skip to content

Commit

Permalink
add intial github action for building node
Browse files Browse the repository at this point in the history
  • Loading branch information
liudonghua123 committed Jan 16, 2024
1 parent 3b1db8a commit 7554bd5
Showing 1 changed file with 134 additions and 0 deletions.
134 changes: 134 additions & 0 deletions .github/workflows/node-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
name: Node Build

on:
workflow_dispatch:
inputs:
node_tag:
description: 'The tag of node to build'
required: true
default: v20.11.0
push:

permissions: write-all

defaults:
run:
shell: bash

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
with-intl: [none, system-icu, small-icu, full-icu]
include:
- os: ubuntu-latest
with-intl: none
platform: linux
arch: x64
- os: ubuntu-latest
with-intl: system-icu
platform: linux
arch: x64
- os: ubuntu-latest
with-intl: small-icu
platform: linux
arch: x64
- os: ubuntu-latest
with-intl: full-icu
platform: linux
arch: x64
- os: macos-latest
with-intl: none
platform: macos
arch: x64
- os: macos-latest
with-intl: system-icu
platform: macos
arch: x64
- os: macos-latest
with-intl: small-icu
platform: macos
arch: x64
- os: macos-latest
with-intl: full-icu
platform: macos
arch: x64
- os: windows-latest
with-intl: none
platform: windows
arch: x64
# - os: windows-latest
# with-intl: system-icu
# platform: windows
# arch: x64
- os: windows-latest
with-intl: small-icu
platform: windows
arch: x64
- os: windows-latest
with-intl: full-icu
platform: windows
arch: x64

steps:
- uses: actions/checkout@v3
with:
repository: 'nodejs/node'
ref: ${{ github.event.inputs.node_tag }}
- name: Check root
run: |
pwd
ls -l
- name: Install ubuntu deps
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update -y
sudo apt install -y build-essential python3 python3-pip make libicu-dev
- name: Install macos deps
if: matrix.os == 'macos-latest'
run: |
sudo brew update
sudo brew install icu4c pkg-config make
- name: Install windows deps
if: matrix.os == 'windows-latest'
run: |
echo ok!
- name: Initialization ...
run: |
echo ok!
- name: Building ...
if: matrix.os != 'windows-latest'
run: |
./configure --with-ltcg --with-intl=${{ matrix.with-intl }}
make -j$(nproc)
- name: Building ...
if: matrix.os == 'windows-latest'
run: |
# if with-intl is none, then use intl-none as build argument
intl=${{ matrix.with-intl }}
if [ "${intl}" == "none" ]; then
intl=intl-none
fi
./vcbuild.bat ${{ matrix.arch }} ltcg ${intl}
make -j$(nproc)
- name: Inspecting ...
run: |
ls -lR out
- name: Prepare on windows ...
if: matrix.os != 'windows-latest'
run: |
cp out/Release/node node-${{ matrix.platform }}-${{ matrix.arch }}-${{ github.event.inputs.node_tag }}-with-intl-${{ matrix.with-intl }}
- name: Prepare on ubuntu ...
if: matrix.os == 'windows-latest'
run: |
cp out/Release/node.exe node-${{ matrix.platform }}-${{ matrix.arch }}-${{ github.event.inputs.node_tag }}-with-intl-${{ matrix.with-intl }}.exe
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: node-*


0 comments on commit 7554bd5

Please sign in to comment.