Skip to content

Commit d36f1a8

Browse files
authored
Merge pull request #41 from nut-tree/feature/40/github_actions
Feature/40/GitHub actions
2 parents 93d67ff + bfb528c commit d36f1a8

File tree

13 files changed

+207
-156
lines changed

13 files changed

+207
-156
lines changed

Diff for: .build/pre-release.ps1

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
"//registry.npmjs.org/:_authToken=$env:NPM_TOKEN`n" | out-file "$env:userprofile\.npmrc" -Encoding ASCII
2+
npm whoami
3+
4+
$timestamp = Get-Date -Format yyyyMMddhhmmss
5+
$patchVersion = (npm --no-git-tag version patch)
6+
$nextVersion = "${patchVersion}-next.${timestamp}".Substring(1)
7+
echo $nextVersion
8+
9+
npm version --no-git-tag -f $nextVersion
10+
npm run publish:next

Diff for: .build/pre-release.sh

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/usr/bin/env bash
22
set -ex
33

4+
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
5+
npm whoami
6+
47
patchVersion=$(npm --no-git-tag version patch)
58
nextVersion=${patchVersion}-next."$(date +%Y%m%d%H%M%S)"
69
echo "${nextVersion:1}"

Diff for: .build/release.ps1

-21
This file was deleted.

Diff for: .build/release.sh

-4
This file was deleted.

Diff for: .github/workflows/ci.yaml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Run CI
2+
on:
3+
push:
4+
branches-ignore:
5+
- develop
6+
- release/**
7+
pull_request:
8+
9+
jobs:
10+
test:
11+
strategy:
12+
matrix:
13+
os: [ ubuntu-latest, windows-latest, macos-latest ]
14+
node: [ 10, 12, 14 ]
15+
runs-on: ${{matrix.os}}
16+
steps:
17+
- name: Set up Git repository
18+
uses: actions/checkout@v2
19+
- name: Set up node
20+
uses: actions/setup-node@v2
21+
with:
22+
node-version: ${{matrix.node}}
23+
- name: Configure Linux environment
24+
if: ${{matrix.os == 'ubuntu-latest'}}
25+
run: |
26+
sudo apt-get install -y cmake libx11-dev zlib1g-dev libpng-dev libxtst-dev g++-4.8 gcc-4.8
27+
export CXX=g++-4.8 && $CXX --version
28+
- name: Install
29+
run: npm run patch && npm i
30+
- name: Build
31+
run: npm run build:release
32+
- name: Run tests
33+
uses: GabrielBB/xvfb-action@v1
34+
with:
35+
working-directory: ./test/
36+
run: npm cit
37+
- name: Run window tests
38+
uses: GabrielBB/xvfb-action@v1
39+
with:
40+
working-directory: ./test/window-integration-tests
41+
run: npm cit

Diff for: .github/workflows/snapshot_release.yaml

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Create snapshot release
2+
on:
3+
push:
4+
branches:
5+
- develop
6+
7+
jobs:
8+
test:
9+
strategy:
10+
matrix:
11+
os: [ ubuntu-latest, windows-latest, macos-latest ]
12+
runs-on: ${{matrix.os}}
13+
steps:
14+
- name: Set up Git repository
15+
uses: actions/checkout@v2
16+
- name: Set up node
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: ${{matrix.node}}
20+
- name: Configure Linux environment
21+
if: ${{matrix.os == 'ubuntu-latest'}}
22+
run: |
23+
sudo apt-get install -y cmake libx11-dev zlib1g-dev libpng-dev libxtst-dev g++-4.8 gcc-4.8
24+
export CXX=g++-4.8 && $CXX --version
25+
- name: Install
26+
run: npm run patch && npm i
27+
- name: Build
28+
run: npm run build:release
29+
- name: Run tests
30+
uses: GabrielBB/xvfb-action@v1
31+
with:
32+
working-directory: ./test/
33+
run: npm cit
34+
- name: Run window tests
35+
uses: GabrielBB/xvfb-action@v1
36+
with:
37+
working-directory: ./test/window-integration-tests
38+
run: npm cit
39+
40+
deploy:
41+
needs:
42+
- test
43+
strategy:
44+
matrix:
45+
os: [ ubuntu-latest, windows-latest, macos-latest ]
46+
runs-on: ${{matrix.os}}
47+
steps:
48+
- name: Set up Git repository
49+
uses: actions/checkout@v2
50+
- name: Set up node
51+
uses: actions/setup-node@v2
52+
with:
53+
node-version: 14
54+
- name: Configure Linux environment
55+
if: ${{matrix.os == 'ubuntu-latest'}}
56+
run: |
57+
sudo apt-get install -y cmake libx11-dev zlib1g-dev libpng-dev libxtst-dev g++-4.8 gcc-4.8
58+
export CXX=g++-4.8 && $CXX --version
59+
- name: Install
60+
run: npm run patch && npm i
61+
- name: Publish snapshot release
62+
if: ${{matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'}}
63+
run: ./.build/pre-release.sh
64+
shell: bash
65+
env:
66+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
67+
- name: Publish Windows snapshot release
68+
if: ${{matrix.os == 'windows-latest'}}
69+
run: ./.build/pre-release.ps1
70+
shell: powershell
71+
env:
72+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

Diff for: .github/workflows/tagged_release.yaml

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Create tagged release
2+
on:
3+
push:
4+
tags:
5+
- v*.*.*
6+
7+
jobs:
8+
test:
9+
strategy:
10+
matrix:
11+
os: [ ubuntu-latest, windows-latest, macos-latest ]
12+
node: [ 10, 12, 14 ]
13+
runs-on: ${{matrix.os}}
14+
steps:
15+
- name: Set up Git repository
16+
uses: actions/checkout@v2
17+
- name: Set up node
18+
uses: actions/setup-node@v2
19+
with:
20+
node-version: ${{matrix.node}}
21+
- name: Configure Linux environment
22+
if: ${{matrix.os == 'ubuntu-latest'}}
23+
run: |
24+
sudo apt-get install -y cmake libx11-dev zlib1g-dev libpng-dev libxtst-dev g++-4.8 gcc-4.8
25+
export CXX=g++-4.8 && $CXX --version
26+
- name: Install
27+
run: npm run patch && npm i
28+
- name: Build
29+
run: npm run build:release
30+
- name: Run tests
31+
uses: GabrielBB/xvfb-action@v1
32+
with:
33+
working-directory: ./test/
34+
run: npm cit
35+
- name: Run window tests
36+
uses: GabrielBB/xvfb-action@v1
37+
with:
38+
working-directory: ./test/window-integration-tests
39+
run: npm cit
40+
41+
deploy:
42+
needs:
43+
- test
44+
strategy:
45+
matrix:
46+
os: [ ubuntu-latest, windows-latest, macos-latest ]
47+
runs-on: ${{matrix.os}}
48+
steps:
49+
- name: Set up Git repository
50+
uses: actions/checkout@v2
51+
- name: Set up node
52+
uses: actions/setup-node@v2
53+
with:
54+
node-version: 14
55+
- name: Configure Linux environment
56+
if: ${{matrix.os == 'ubuntu-latest'}}
57+
run: |
58+
sudo apt-get install -y cmake libx11-dev zlib1g-dev libpng-dev libxtst-dev g++-4.8 gcc-4.8
59+
export CXX=g++-4.8 && $CXX --version
60+
- name: Install
61+
run: npm run patch && npm i
62+
- name: Publish tagged release
63+
uses: JS-DevTools/npm-publish@v1
64+
with:
65+
token: ${{ secrets.NPM_TOKEN }}

Diff for: .travis.yml

-64
This file was deleted.

Diff for: appveyor.yml

-45
This file was deleted.

Diff for: package-lock.json

+3-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+2-9
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,8 @@
77
"scripts": {
88
"clean": "cmake-js clean",
99
"patch": "node ./patch-packagename.js",
10-
"build:debug": "run-script-os",
11-
"build:debug:default": "cmake-js rebuild --debug",
12-
"build:debug:win32": "cmake-js rebuild --debug -G \"Visual Studio 15 2017 Win64\"",
13-
"build:release": "run-script-os",
14-
"build:release:default": "cmake-js rebuild",
15-
"build:release:win32": "cmake-js rebuild -G \"Visual Studio 15 2017 Win64\"",
10+
"build:debug": "cmake-js rebuild --debug",
11+
"build:release": "cmake-js rebuild",
1612
"prepublishOnly": "npm run build:release",
1713
"publish:next": "npm publish --tag next"
1814
},
@@ -45,8 +41,5 @@
4541
},
4642
"engines": {
4743
"node": ">=10.15.3"
48-
},
49-
"devDependencies": {
50-
"run-script-os": "1.1.1"
5144
}
5245
}

0 commit comments

Comments
 (0)