Skip to content

Commit

Permalink
Update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
thegecko committed Dec 29, 2022
1 parent ae8f971 commit 7347294
Show file tree
Hide file tree
Showing 7 changed files with 128 additions and 40 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: build

on:
push:
pull_request:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v3
with:
node-version: 16
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: yarn install --ignore-scripts
- run: yarn build:ts
37 changes: 0 additions & 37 deletions .github/workflows/ci.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: docs

on:
push:
branches:
- master
workflow_dispatch:

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v3
with:
node-version: 16
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: yarn install --ignore-scripts
- run: yarn build:ts
- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
enable_jekyll: false
79 changes: 79 additions & 0 deletions .github/workflows/prebuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: prebuild

on:
push:
branches:
- master
tags:
- '*'
pull_request:
branches:
- master
workflow_dispatch:

jobs:
prebuild:
strategy:
fail-fast: false
matrix:
include:
- name: darwin
os: macos-latest
node: x64
command: prebuild --arch x64+arm64
- name: win32-x86
os: windows-latest
node: x86
command: prebuild
- name: win32-x64
os: windows-latest
node: x64
command: prebuild
- name: linux-x64
os: ubuntu-latest
node: x64
command: prebuild
name: Build ${{ matrix.name }}
runs-on: ${{ matrix.os }}
steps:
- if: matrix.node
uses: actions/setup-node@v3
with:
node-version: 16
architecture: ${{ matrix.node }}
- uses: actions/checkout@v3
with:
submodules: recursive
- if: contains(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y libdbus-1-dev
- if: contains(matrix.os, 'macos')
uses: jwlawson/actions-setup-cmake@v1.12
with:
cmake-version: '3.21.x'
- if: contains(matrix.os, 'windows')
uses: microsoft/setup-msbuild@v1.0.2
- run: yarn install --ignore-scripts
- run: yarn ${{ matrix.command }}
- run: tar -zcvf ${{ matrix.name }}.tar.gz -C prebuilds .
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.name }}
path: ${{ matrix.name }}.tar.gz
retention-days: 1
release:
needs: prebuild
name: Release
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
path: artifacts
- uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: artifacts/*/*.tar.gz
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_Store
node_modules
build
prebuilds
dist
docs
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Node Web Bluetooth
Node.js implementation of the Web Bluetooth Specification

[![Build Status](https://github.com/thegecko/webbluetooth/workflows/ci/badge.svg)](https://github.com/thegecko/webbluetooth/actions)
[![Build Status](https://github.com/thegecko/webbluetooth/workflows/prebuild/badge.svg)](https://github.com/thegecko/webbluetooth/actions)
[![npm](https://img.shields.io/npm/dm/webbluetooth.svg)](https://www.npmjs.com/package/webbluetooth)
[![Licence MIT](https://img.shields.io/badge/licence-MIT-blue.svg)](http://opensource.org/licenses/MIT)

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
"scripts": {
"install": "prebuild-install --backend cmake-js --runtime napi || cmake-js rebuild",
"clean": "yarn clean:cpp && yarn clean:ts",
"clean:cpp": "cmake-js clean",
"clean:cpp": "cmake-js clean && git clean -fx ./prebuilds",
"clean:ts": "git clean -fx ./dist ./docs",
"build": "yarn build:cpp && yarn build:ts",
"build:all": "yarn build:cpp && yarn build:ts",
"build:cpp": "cmake-js compile",
"build:ts": "tsc && yarn lint && yarn docs",
"watch": "tsc -w --preserveWatchOutput",
Expand Down

0 comments on commit 7347294

Please sign in to comment.