Skip to content

Commit

Permalink
🎉 开始原生 addon 支持
Browse files Browse the repository at this point in the history
  • Loading branch information
muwoo committed Sep 26, 2023
0 parents commit 3218c39
Show file tree
Hide file tree
Showing 52 changed files with 3,289 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .build/pre-release.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"//registry.npmjs.org/:_authToken=$env:NPM_TOKEN`n" | out-file "$env:userprofile\.npmrc" -Encoding ASCII
npm whoami

$timestamp = Get-Date -Format yyyyMMddhhmmss
$patchVersion = (npm --no-git-tag version patch)
$nextVersion = "${patchVersion}-next.${timestamp}".Substring(1)
echo $nextVersion

npm version --no-git-tag -f $nextVersion
npm run publish:next
12 changes: 12 additions & 0 deletions .build/pre-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -ex

echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
npm whoami

patchVersion=$(npm --no-git-tag version patch)
nextVersion=${patchVersion}-next."$(date +%Y%m%d%H%M%S)"
echo "${nextVersion:1}"

npm version --no-git-tag -f "${nextVersion:1}"
npm run publish:next
Empty file added .github/CONTRIBUTING.md
Empty file.
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# These are supported funding model platforms

github: s1hofmann
patreon: s1hofmann
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Bug report
about: Create a bug report to help us enhance our images
---

**Version**

**Short overview**

**Detailed error description**

**Steps to reproduce error**

**Additional content**
> Please provide any (mandatory) additional data to reproduce the error (Dockerfiles etc.)
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/enhancement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: Enhancement
about: Suggest a possible enhancement to the project
---

**Short overview**

**Use case**

**Detailed description**

**Additional content**
> Please provide any (mandatory) additional data for your enhancement
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: Feature request
about: Open a feature request
---

**Short overview**

**Use case**

**Detailed feature description**

**Additional content**
> Please provide any (mandatory) additional data for your desired feature
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: Question
about: File a request to resolve open questions
---

**Short summary**

**Detailed question**
15 changes: 15 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Bugfix
about: Request to merge a bugfix
---

**Short summary**

**Detailed description (motivation, use-case etc.)**

**Screenshots (if appropriate)**

**Checklist**

- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
15 changes: 15 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/enhancement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Enhancement
about: Request to merge an enhancement
---

**Short summary**

**Detailed description (motivation, use-case etc.)**

**Screenshots (if appropriate)**

**Checklist**

- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
15 changes: 15 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Feature
about: Request to merge a new feature
---

**Short summary**

**Detailed description (motivation, use-case etc.)**

**Screenshots (if appropriate)**

**Checklist**

- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
39 changes: 39 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Run CI
on:
push:
branches-ignore:
- develop
- release/**
pull_request:

jobs:
test:
strategy:
matrix:
os: [ ubuntu-20.04, macos-11, windows-2019 ]
node: [ 16 ]
runs-on: ${{matrix.os}}
steps:
- name: Set up Git repository
uses: actions/checkout@v2
- name: Set up node
uses: actions/setup-node@v2
with:
node-version: ${{matrix.node}}
- name: Configure Linux environment
if: ${{matrix.os == 'ubuntu-20.04'}}
run: sudo apt-get install -y cmake libx11-dev zlib1g-dev libpng-dev libxtst-dev build-essential
- name: Install
run: npm run patch && npm i
- name: Build
run: npm run build:release
- name: Run tests
uses: GabrielBB/xvfb-action@v1
with:
working-directory: ./test/
run: npm cit
- name: Run window tests
uses: GabrielBB/xvfb-action@v1
with:
working-directory: ./test/window-integration-tests
run: npm cit
87 changes: 87 additions & 0 deletions .github/workflows/snapshot_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Create snapshot release
on:
push:
branches:
- develop
workflow_dispatch:
inputs:
reason:
description: 'Reason for the snapshot release'
required: true
default: 'Snapshot release'

jobs:
test:
strategy:
matrix:
os: [ ubuntu-20.04, macos-11, windows-2019 ]
runs-on: ${{matrix.os}}
steps:
- name: Set up Git repository
uses: actions/checkout@v2
- name: Set up node
uses: actions/setup-node@v2
with:
node-version: ${{matrix.node}}
- name: Configure Linux environment
if: ${{matrix.os == 'ubuntu-20.04'}}
run: sudo apt-get install -y cmake libx11-dev zlib1g-dev libpng-dev libxtst-dev build-essential
- name: Install
run: npm run patch && npm i
- name: Build
run: npm run build:release
- name: Run tests
uses: GabrielBB/xvfb-action@v1
with:
working-directory: ./test/
run: npm cit
- name: Run window tests
if: ${{matrix.os == 'windows-2019'}}
uses: GabrielBB/xvfb-action@v1
with:
working-directory: ./test/window-integration-tests
run: npm cit

deploy:
needs:
- test
strategy:
matrix:
os: [ ubuntu-20.04, macos-11, windows-2019 ]
runs-on: ${{matrix.os}}
steps:
- name: Set up Git repository
uses: actions/checkout@v2
- name: Set up node
uses: actions/setup-node@v2
with:
node-version: 14
- name: Configure Linux environment
if: ${{matrix.os == 'ubuntu-20.04'}}
run: sudo apt-get install -y cmake libx11-dev zlib1g-dev libpng-dev libxtst-dev build-essential
- name: Install
run: npm run patch && npm i
- name: Publish snapshot release
if: ${{matrix.os == 'ubuntu-20.04' || matrix.os == 'macos-11'}}
run: ./.build/pre-release.sh
shell: bash
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish Windows snapshot release
if: ${{matrix.os == 'windows-2019'}}
run: ./.build/pre-release.ps1
shell: powershell
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

dispatch:
needs:
- deploy
runs-on: ubuntu-20.04
steps:
- name: Dispatch snapshot release
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.SNAPSHOT_DISPATCH_TOKEN }}
repository: nut-tree/libnut-install
event-type: snapshot-release
61 changes: 61 additions & 0 deletions .github/workflows/tagged_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Create tagged release
on:
push:
tags:
- v*.*.*

jobs:
test:
strategy:
matrix:
os: [ ubuntu-20.04, macos-11, windows-2019 ]
runs-on: ${{matrix.os}}
steps:
- name: Set up Git repository
uses: actions/checkout@v2
- name: Set up node
uses: actions/setup-node@v2
with:
node-version: ${{matrix.node}}
- name: Configure Linux environment
if: ${{matrix.os == 'ubuntu-20.04'}}
run: sudo apt-get install -y cmake libx11-dev zlib1g-dev libpng-dev libxtst-dev build-essential
- name: Install
run: npm run patch && npm i
- name: Build
run: npm run build:release
- name: Run tests
uses: GabrielBB/xvfb-action@v1
with:
working-directory: ./test/
run: npm cit
- name: Run window tests
if: ${{matrix.os == 'windows-2019'}}
uses: GabrielBB/xvfb-action@v1
with:
working-directory: ./test/window-integration-tests
run: npm cit

deploy:
needs:
- test
strategy:
matrix:
os: [ ubuntu-20.04, macos-11, windows-2019 ]
runs-on: ${{matrix.os}}
steps:
- name: Set up Git repository
uses: actions/checkout@v2
- name: Set up node
uses: actions/setup-node@v2
with:
node-version: 14
- name: Configure Linux environment
if: ${{matrix.os == 'ubuntu-20.04'}}
run: sudo apt-get install -y cmake libx11-dev zlib1g-dev libpng-dev libxtst-dev build-essential
- name: Install
run: npm run patch && npm i
- name: Publish tagged release
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
build/
node_modules/
prebuilds/
.idea
.vscode
.cache
cmake-build-debug
.DS_Store
21 changes: 21 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.idea
.vscode
.build
.github
3rdparty
build/CMakeFiles
build/cmake_install.cmake
build/CMakeCache.txt
build/Makefile
build/*.vcxproj*
build/*.sln
build/x64/
build/libnut.dir/
CMakeFiles
src
test
.travis.yml
CMakeLists.txt
GPATH
GRTAGS
GTAGS
Binary file added 3rdparty/win32/api-ms-win-crt-heap-l1-1-0.dll
Binary file not shown.
Binary file added 3rdparty/win32/api-ms-win-crt-runtime-l1-1-0.dll
Binary file not shown.
Binary file added 3rdparty/win32/api-ms-win-crt-string-l1-1-0.dll
Binary file not shown.
Binary file added 3rdparty/win32/msvcp140.dll
Binary file not shown.
Binary file added 3rdparty/win32/vcruntime140.dll
Binary file not shown.
Binary file added 3rdparty/win32/vcruntime140_1.dll
Binary file not shown.
Loading

0 comments on commit 3218c39

Please sign in to comment.