Skip to content
This repository was archived by the owner on Apr 13, 2025. It is now read-only.

Commit 450291e

Browse files
authored
Merge pull request #364 from codeoverflow-org/next
Release nodecg-io-cli 0.4
2 parents 80f1498 + d7b8e5a commit 450291e

25 files changed

+7808
-5570
lines changed

.devcontainer/devcontainer.json

+16-6
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,24 @@
66
"dockerfile": "Dockerfile"
77
},
88

9-
// Set *default* container specific settings.json values on container create.
10-
"settings": {
11-
"terminal.integrated.shell.linux": "/bin/zsh"
9+
"customizations": {
10+
"vscode": {
11+
"extensions": ["dbaeumer.vscode-eslint", "Orta.vscode-jest"],
12+
"settings": {
13+
"terminal.integrated.profiles.linux": {
14+
"bash": {
15+
"path": "bash",
16+
"icon": "terminal-bash"
17+
},
18+
"zsh": {
19+
"path": "zsh"
20+
}
21+
},
22+
"terminal.integrated.defaultProfile.linux": "zsh"
23+
}
24+
}
1225
},
1326

14-
// Add the IDs of extensions you want installed when the container is created.
15-
"extensions": ["dbaeumer.vscode-eslint"],
16-
1727
// Use 'forwardPorts' to make a list of ports inside the container available locally.
1828
// 9090 is the default nodecg port if you have setup a nodecg install using the install command and want to test it
1929
"forwardPorts": [9090],

.devcontainer/postCreate.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ npm link
88
# Get nodecg so you can test the cli using this installation
99
[ ! -d "nodecg" ] && git clone https://github.com/nodecg/nodecg.git
1010

11-
cd nodecg && npm i --omit=dev
11+
cd nodecg && npm i && npm run build

.github/workflows/ci.yaml

+85-85
Original file line numberDiff line numberDiff line change
@@ -2,88 +2,88 @@ name: CI
22

33
on: [push, pull_request]
44
jobs:
5-
unit_test:
6-
strategy:
7-
fail-fast: false
8-
matrix:
9-
os: [ubuntu-latest, windows-2019]
10-
node: [12, 14, 16, 18]
11-
12-
runs-on: ${{ matrix.os }}
13-
steps:
14-
- uses: actions/checkout@v3
15-
- uses: actions/setup-node@v3
16-
with:
17-
node-version: ${{ matrix.node }}
18-
19-
- name: Install nodejs dependencies
20-
run: npm ci
21-
22-
- name: Build TS
23-
run: npm run build
24-
25-
- name: Run tests
26-
run: npm run test
27-
28-
integration_test:
29-
strategy:
30-
fail-fast: false
31-
matrix:
32-
os: [ubuntu-latest, windows-2019]
33-
version: ['0.1', '0.2', 'development']
34-
node: [14, 18]
35-
36-
runs-on: ${{ matrix.os }}
37-
steps:
38-
- uses: actions/checkout@v3
39-
- uses: actions/setup-node@v3
40-
with:
41-
node-version: ${{ matrix.node }}
42-
43-
- name: Install system dependencies
44-
if: matrix.os == 'ubuntu-latest'
45-
run: sudo apt update && sudo apt-get -y install libusb-1.0-0-dev libasound2-dev libudev-dev
46-
47-
- name: Upgrade npm
48-
run: npm i -g [email protected]
49-
50-
- name: Install node native development files
51-
shell: bash
52-
run: npx node-gyp install
53-
54-
- name: Install nodejs dependencies
55-
run: npm ci
56-
57-
- name: Build
58-
run: npm run build && npm link
59-
60-
- name: Run integration test
61-
shell: bash
62-
run: ./integration_test.sh ${{ matrix.version }}
63-
64-
release:
65-
name: Release
66-
runs-on: ubuntu-latest
67-
# not run for dependabot because it shouldn't trigger releases and has no write tokens
68-
# not run in forks because they are missing secrets too
69-
# only run for the main branch
70-
if: github.actor != 'dependabot[bot]' && startsWith(github.repository, 'codeoverflow-org') && github.ref == 'refs/heads/main'
71-
needs:
72-
- unit_test
73-
- integration_test
74-
steps:
75-
- name: Checkout
76-
uses: actions/checkout@v3
77-
- name: Setup Node.js
78-
uses: actions/setup-node@v3
79-
with:
80-
node-version: 18
81-
82-
- name: Install dependencies
83-
run: npm ci
84-
85-
- name: Release
86-
env:
87-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
89-
run: npx semantic-release
5+
unit_test:
6+
strategy:
7+
fail-fast: false
8+
matrix:
9+
os: [ubuntu-latest, windows-2019]
10+
node: [14, 16, 18]
11+
12+
runs-on: ${{ matrix.os }}
13+
steps:
14+
- uses: actions/checkout@v3
15+
- uses: actions/setup-node@v3
16+
with:
17+
node-version: ${{ matrix.node }}
18+
19+
- name: Install nodejs dependencies
20+
run: npm ci
21+
22+
- name: Build TS
23+
run: npm run build
24+
25+
- name: Run tests
26+
run: npm run test
27+
28+
integration_test:
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
os: [ubuntu-latest, windows-2019]
33+
version: ["0.1", "0.2", "development"]
34+
node: [14, 18]
35+
36+
runs-on: ${{ matrix.os }}
37+
steps:
38+
- uses: actions/checkout@v3
39+
- uses: actions/setup-node@v3
40+
with:
41+
node-version: ${{ matrix.node }}
42+
43+
- name: Install system dependencies
44+
if: matrix.os == 'ubuntu-latest'
45+
run: sudo apt update && sudo apt-get -y install libusb-1.0-0-dev libasound2-dev libudev-dev
46+
47+
- name: Upgrade npm
48+
run: npm i -g [email protected]
49+
50+
- name: Install node native development files
51+
shell: bash
52+
run: npx node-gyp install
53+
54+
- name: Install nodejs dependencies
55+
run: npm ci
56+
57+
- name: Build
58+
run: npm run build && npm link
59+
60+
- name: Run integration test
61+
shell: bash
62+
run: ./integration_test.sh ${{ matrix.version }}
63+
64+
release:
65+
name: Release
66+
runs-on: ubuntu-latest
67+
# not run for dependabot because it shouldn't trigger releases and has no write tokens
68+
# not run in forks because they are missing secrets too
69+
# only run for the main branch
70+
if: github.actor != 'dependabot[bot]' && startsWith(github.repository, 'codeoverflow-org') && github.ref == 'refs/heads/main'
71+
needs:
72+
- unit_test
73+
- integration_test
74+
steps:
75+
- name: Checkout
76+
uses: actions/checkout@v3
77+
- name: Setup Node.js
78+
uses: actions/setup-node@v3
79+
with:
80+
node-version: 18
81+
82+
- name: Install dependencies
83+
run: npm ci
84+
85+
- name: Release
86+
env:
87+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
89+
run: npx semantic-release

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ The following table show which versions of the CLI are compatible with which nod
6060
| CLI versions | nodecg-io versions |
6161
| ------------ | ------------------ |
6262
| `0.1` | `0.1` |
63-
| `0.3`, `0.2` | `0.2`, `0.1` |
63+
| `0.2-0.4` | `0.2`, `0.1` |
6464

6565
## Developer workflow
6666

integration_test.sh

+8-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,14 @@ function clean_test_directory {
2222
trap clean_test_directory EXIT
2323

2424
cd $dir
25-
git clone https://github.com/nodecg/nodecg.git --depth 1 .
25+
26+
# Download NodeCG
27+
if [ "$version" == "0.1" ] || [ "$version" == "0.2" ]; then
28+
# if version is 0.1 or 0.2 then switch back to NodeCG v1
29+
git clone https://github.com/nodecg/nodecg.git --depth 1 --branch legacy-1.x .
30+
else
31+
git clone https://github.com/nodecg/nodecg.git --depth 1 .
32+
fi
2633

2734
if [ "$version" == "development" ]; then
2835
nodecg-io install --nodecg-io-version $version --docs

0 commit comments

Comments
 (0)