Skip to content

Build Node.JS

Build Node.JS #18

Workflow file for this run

name: Build Node.JS
on:
workflow_dispatch:
inputs:
version:
description: "The version to checkout and build to"
required: True
default: "14.17.5"
jobs:
build-mac-release:
name: Build the release on MacOS
runs-on: macos-12
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install ninja on macOS
run: HOMEBREW_NO_AUTO_UPDATE=1 brew install ninja
- name: Download node.js source code
run: python -m nodejs.download ${{ github.event.inputs.version }}
- name: Build the libraries
run: python -m nodejs.build Release
- name: Archive
run: |
zipname=$(python -m nodejs.archive Release)
echo "::set-output name=zipname::$zipname"
shell: bash
id: archive
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: ${{ steps.archive.outputs.zipname }}
path: ${{ steps.archive.outputs.zipname }}
build-linux-release:
name: Build the release on Linux
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install ninja on Ubuntu
run: sudo apt-get install -y ninja-build
- name: Download node.js source code
run: python -m nodejs.download ${{ github.event.inputs.version }}
- name: Build the libraries
run: python -m nodejs.build Release
- name: Archive
run: |
zipname=$(python -m nodejs.archive Release)
echo "::set-output name=zipname::$zipname"
shell: bash
id: archive
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: ${{ steps.archive.outputs.zipname }}
path: ${{ steps.archive.outputs.zipname }}
build-windows-release:
name: Build the release on Windows
runs-on: self-hosted
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Update CA
run: pip install python-certifi-win32
- name: Install nasm on Windows
run: choco install -y nasm
- name: Install GNU patch on Windows
run: choco install -y patch
- name: Download node.js source code
run: python -m nodejs.download ${{ github.event.inputs.version }}
- name: Build the libraries
run: python -m nodejs.build Release
- name: Archive
run: |
zipname=$(python -m nodejs.archive Release)
echo "::set-output name=zipname::$zipname"
shell: bash
id: archive
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: ${{ steps.archive.outputs.zipname }}
path: ${{ steps.archive.outputs.zipname }}
build-windows-debug:
runs-on: self-hosted
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Update CA
run: pip install python-certifi-win32
- name: Install nasm on Windows
run: choco install -y nasm
- name: Install GNU patch on Windows
run: choco install -y patch
- name: Download node.js source code
run: python -m nodejs.download ${{ github.event.inputs.version }}
- name: Build the libraries
run: python -m nodejs.build Debug
- name: Archive
run: |
zipname=$(python -m nodejs.archive Debug)
echo "::set-output name=zipname::$zipname"
shell: bash
id: archive
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: ${{ steps.archive.outputs.zipname }}
path: ${{ steps.archive.outputs.zipname }}
release:
needs:
- build-windows-release
- build-windows-debug
- build-linux-release
- build-mac-release
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v2
- name: Prepare zips
run: |
mkdir zips
mv ./*/*.zip ./zips
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: nodejs-${{ github.event.inputs.version }}
release_name: nodejs-${{ github.event.inputs.version }}
- name: Upload release assets
uses: csexton/release-asset-action@v2
with:
pattern: "zips/*.zip"
github-token: ${{ secrets.GITHUB_TOKEN }}
release-url: ${{ steps.create_release.outputs.upload_url }}