Skip to content

Commit 789592f

Browse files
committed
(#40) Added workflows for snapshot and tagged releases
1 parent f861d6c commit 789592f

File tree

2 files changed

+137
-0
lines changed

2 files changed

+137
-0
lines changed
+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 }}

.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 }}

0 commit comments

Comments
 (0)