Skip to content

Commit

Permalink
add build action
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed May 16, 2024
1 parent 55fde4c commit 2b826c2
Showing 1 changed file with 84 additions and 0 deletions.
84 changes: 84 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Build cross platform

# Controls when the action will run. Triggers the workflow on push
on:
push:
pull_request:
release:
# tags:
# - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Windows Latest MSVC",
os: windows-latest,
}
- {
name: "Ubuntu_Latest_GCC",
os: ubuntu-latest,
}
- {
name: "macOS Latest Clang",
os: macos-latest,
}

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4

- name: Print env
run: |
echo github.event.action: ${{ github.event.action }}
echo github.event_name: ${{ github.event_name }}
- name: Install dependencies on windows
if: startsWith(matrix.config.os, 'windows')
run: |
choco install node cmake
node --version
cmake --version
# cmd "${{ matrix.config.environment_script }}"

- name: Install dependencies on ubuntu
uses: actions/setup-node@v4
if: startsWith(matrix.config.name, 'Ubuntu_Latest_GCC')
run: |
sudo apt-get update
sudo apt-get install cmake
cmake --version
gcc --version
- name: Install dependencies on macos
uses: actions/setup-node@v4
if: startsWith(matrix.config.os, 'macos')
run: |
brew install cmake
cmake --version
- name: Build
shell: bash
run: |
npm ci
npm run build
#- name: Upload
# uses: actions/upload-artifact@v1
# with:
# path: ./${{ matrix.config.artifact }}
# name: ${{ matrix.config.artifact }}
#
#- name: Upload release asset
# if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'created')
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ github.event.release.upload_url }}
# asset_path: ./${{ matrix.config.artifact }}
# asset_name: ${{ matrix.config.artifact }}.zip
# asset_content_type: application/zip

0 comments on commit 2b826c2

Please sign in to comment.