Skip to content

GitHub actions asset build #1

GitHub actions asset build

GitHub actions asset build #1

Workflow file for this run

name: Build asset
on:
schedule:
- cron: '0 10 * * 1'
workflow_dispatch:
inputs:
versions:
description: 'Node.js version'
required: true
default: '[ "lts/*", "18" ]'
pull_request:
branches: [ master ]
push:
branches: [ master ]
tags: [ '*' ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ windows-latest, macos-latest, ubuntu-latest ]
version: ${{ fromJSON(inputs.versions) }}
env:
NODEJS_VERSION: ${{ matrix.version }}
NEXE_ASSET: ${{ github.workspace }}/nexe-asset
NEXE_TMP_CACHE_PATH: ${{ github.workspace }}/nexe-tmp
NEXE_TMP: ${{ github.workspace }}/nexe-tmp/standard
ErrorView: NormalView
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '${{ env.NODEJS_VERSION }}'
- run: npm ci
- uses: actions/setup-python@v2
with:
python-version: 3.9
- if: ${{ matrix.os == 'windows-latest' }}
run: choco install nasm
- if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo apt-get update
- if: ${{ matrix.os != 'windows-latest' }}
uses: hendrikmuhs/ccache-action@v1.2
with:
create-symlink: true
key: ${{ github.job }}-${{ matrix.os }}-${{ matrix.version }}
- if: ${{ matrix.os == 'windows-latest' }}
run: echo "NEXE_ASSET=${{ env.NEXE_ASSET }}.exe" >> $env:GITHUB_ENV
- name: Build and test asset
run: node tasks/asset-build && node tasks/asset-test-build && npm run test:integration:run
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: nexe-asset
path: nexe-asset
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: integration-tests
path: integration-tests
- if: ${{ matrix.os == 'ubuntu-latest' }}
name: musl static build
run: |
export MUSL_BUILD=yes NEXE_TMP=${{ env.NEXE_TMP_CACHE_PATH }}/musl
eval $(npx -p node-musl musl-exports)
export CC="ccache ${CC}" CXX="ccache ${CXX}" LD="ccache ${LD}"
node tasks/asset-build
node tasks/asset-test-build
npm run test:integration:run
- if: ${{ matrix.os == 'ubuntu-latest' }}
name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: nexe-asset-musl
path: nexe-asset
- if: ${{ matrix.os == 'ubuntu-latest' }}
name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: integration-tests-musl
path: integration-tests