Skip to content

Commit

Permalink
Merge pull request #41 from nut-tree/feature/40/github_actions
Browse files Browse the repository at this point in the history
Feature/40/GitHub actions
  • Loading branch information
s1hofmann authored Jan 21, 2021
2 parents 93d67ff + bfb528c commit d36f1a8
Show file tree
Hide file tree
Showing 13 changed files with 207 additions and 156 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
3 changes: 3 additions & 0 deletions .build/pre-release.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/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}"
Expand Down
21 changes: 0 additions & 21 deletions .build/release.ps1

This file was deleted.

4 changes: 0 additions & 4 deletions .build/release.sh

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Run CI
on:
push:
branches-ignore:
- develop
- release/**
pull_request:

jobs:
test:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
node: [ 10, 12, 14 ]
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-latest'}}
run: |
sudo apt-get install -y cmake libx11-dev zlib1g-dev libpng-dev libxtst-dev g++-4.8 gcc-4.8
export CXX=g++-4.8 && $CXX --version
- 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
72 changes: 72 additions & 0 deletions .github/workflows/snapshot_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Create snapshot release
on:
push:
branches:
- develop

jobs:
test:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
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-latest'}}
run: |
sudo apt-get install -y cmake libx11-dev zlib1g-dev libpng-dev libxtst-dev g++-4.8 gcc-4.8
export CXX=g++-4.8 && $CXX --version
- 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

deploy:
needs:
- test
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
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-latest'}}
run: |
sudo apt-get install -y cmake libx11-dev zlib1g-dev libpng-dev libxtst-dev g++-4.8 gcc-4.8
export CXX=g++-4.8 && $CXX --version
- name: Install
run: npm run patch && npm i
- name: Publish snapshot release
if: ${{matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'}}
run: ./.build/pre-release.sh
shell: bash
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish Windows snapshot release
if: ${{matrix.os == 'windows-latest'}}
run: ./.build/pre-release.ps1
shell: powershell
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
65 changes: 65 additions & 0 deletions .github/workflows/tagged_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Create tagged release
on:
push:
tags:
- v*.*.*

jobs:
test:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
node: [ 10, 12, 14 ]
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-latest'}}
run: |
sudo apt-get install -y cmake libx11-dev zlib1g-dev libpng-dev libxtst-dev g++-4.8 gcc-4.8
export CXX=g++-4.8 && $CXX --version
- 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

deploy:
needs:
- test
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
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-latest'}}
run: |
sudo apt-get install -y cmake libx11-dev zlib1g-dev libpng-dev libxtst-dev g++-4.8 gcc-4.8
export CXX=g++-4.8 && $CXX --version
- name: Install
run: npm run patch && npm i
- name: Publish tagged release
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
64 changes: 0 additions & 64 deletions .travis.yml

This file was deleted.

45 changes: 0 additions & 45 deletions appveyor.yml

This file was deleted.

12 changes: 3 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 2 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@
"scripts": {
"clean": "cmake-js clean",
"patch": "node ./patch-packagename.js",
"build:debug": "run-script-os",
"build:debug:default": "cmake-js rebuild --debug",
"build:debug:win32": "cmake-js rebuild --debug -G \"Visual Studio 15 2017 Win64\"",
"build:release": "run-script-os",
"build:release:default": "cmake-js rebuild",
"build:release:win32": "cmake-js rebuild -G \"Visual Studio 15 2017 Win64\"",
"build:debug": "cmake-js rebuild --debug",
"build:release": "cmake-js rebuild",
"prepublishOnly": "npm run build:release",
"publish:next": "npm publish --tag next"
},
Expand Down Expand Up @@ -45,8 +41,5 @@
},
"engines": {
"node": ">=10.15.3"
},
"devDependencies": {
"run-script-os": "1.1.1"
}
}
Loading

0 comments on commit d36f1a8

Please sign in to comment.