Feature/423 build with debian #817
Workflow file for this run
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
name: Build | |
on: | |
push: | |
tags: | |
- "*" | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
lint: | |
runs-on: ubuntu-22.04 | |
env: | |
node_version: 20 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.node_version }} | |
- run: npm install prettier@^3.3.3 | |
- run: npm run test:codestyle | |
build-node: | |
needs: [lint] | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04] | |
node: [17.6.0, 18.8.0, 19.0.0, 20.0.0, 21.7.3, 22.9.0] | |
architecture: [x64] | |
include: | |
- python_version: "3.10" | |
- architecture: x64 | |
architecture_node: x64 | |
target_architecture: x64 | |
runs-on: ${{ matrix.os }} | |
container: | |
image: debian:bullseye-slim | |
credentials: | |
username: "${{ secrets.DOCKER_USERNAME }}" | |
password: "${{ secrets.DOCKER_PASSWORD }}" | |
steps: | |
- name: Set up GCC | |
uses: egor-tensin/setup-gcc@v1 | |
if: ${{ matrix.os == 'ubuntu-20.04' }} | |
with: | |
version: 13 | |
platform: ${{matrix.architecture}} | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python_version }} | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node }} | |
architecture: ${{ matrix.architecture_node }} | |
- run: node --version | |
- run: npm --version | |
- name: Get npm cache directory | |
id: npm-cache-dir | |
shell: bash | |
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} | |
- uses: actions/cache@v4 | |
with: | |
path: ${{ steps.npm-cache-dir.outputs.dir }} | |
key: ${{ runner.os }}-node-${{ matrix.architecture }}-${{ matrix.target_architecture }}-${{matrix.node}}-${{ hashFiles('**/package-lock.json') }} | |
- run: npm install --build-from-source | |
env: | |
npm_config_arch: ${{ matrix.architecture }} | |
npm_config_target_arch: ${{ matrix.target_architecture }} | |
npm_config_python: python${{ matrix.python_version }} | |
npm_config_msbuild_path: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe' | |
CFLAGS: ${{ matrix.extra_compile_flags }} | |
CPPFLAGS: ${{ matrix.extra_compile_flags }} | |
- run: ./node_modules/.bin/node-pre-gyp package testpackage | |
if: ${{ matrix.target_architecture != 'arm64' }} | |
- run: ./node_modules/.bin/node-pre-gyp package --target_arch=${{ matrix.target_architecture }} | |
if: ${{ matrix.target_architecture == 'arm64' }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: build/stage/julianhille/MuhammaraJS/releases/download/**/*.gz | |
name: bindings-electron-${{ matrix.os }}-${{ matrix.target_architecture }}-${{matrix.node}} | |
if-no-files-found: error |