Skip to content

Commit 898fd38

Browse files
Merge pull request #786 from thomasnordquist/tnordquist/test-ci
chore: add ci / cd piplelines as github actions
2 parents a6e16dc + 7fb0483 commit 898fd38

File tree

14 files changed

+3386
-862
lines changed

14 files changed

+3386
-862
lines changed

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package.ts @thomasnordquist
2+
.github @thomasnordquist
3+
scripts @thomasnordquist
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
- release
6+
- beta
7+
paths:
8+
- Dockerfile
9+
- .github
10+
11+
jobs:
12+
create-image:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Set up Docker Buildx
17+
uses: docker/setup-buildx-action@v3
18+
- name: Login to Docker Hub
19+
uses: docker/login-action@v3
20+
with:
21+
registry: ghcr.io
22+
username: ${{ github.actor }}
23+
password: ${{ secrets.GITHUB_TOKEN }}
24+
- name: Build and push
25+
uses: docker/build-push-action@v5
26+
with:
27+
context: .
28+
push: true
29+
tags: ghcr.io/thomasnordquist/mqtt-explorer-ui-tests:latest

.github/workflows/cd.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- release
7+
- beta
8+
9+
concurrency:
10+
group: ${{ github.ref }}
11+
cancel-in-progress: false
12+
13+
jobs:
14+
platform_matrix:
15+
strategy:
16+
matrix:
17+
build:
18+
- os: ubuntu-latest
19+
task: linux
20+
- os: windows-latest
21+
task: win
22+
# - os: macos-latest
23+
# task: mac
24+
runs-on: ${{ matrix.build.os }}
25+
steps:
26+
- if: matrix.build.os == 'ubuntu-latest'
27+
run: sudo snap install snapcraft --classic
28+
- uses: actions/checkout@v4
29+
- uses: actions/setup-node@v4
30+
with:
31+
node-version: 20
32+
- run: npm install -g yarn
33+
- run: yarn
34+
- run: npx semantic-release
35+
env:
36+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
- run: yarn build
38+
- run: yarn prepare-release
39+
# - run: yarn package ${{ matrix.build.task }}
40+
# env:
41+
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
# SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}

.github/workflows/ci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
on:
2+
pull_request_target: # Use pull_request_target
3+
branches: [master, beta, release]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
container:
9+
image: ghcr.io/thomasnordquist/mqtt-explorer-ui-tests:latest
10+
volumes:
11+
- ./:/app
12+
options: --user root
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Install Packages
16+
run: yarn install --frozen-lockfile
17+
- name: Build
18+
run: yarn build
19+
- name: Test
20+
run: yarn test
21+
- name: UI-Test
22+
run: yarn ui-test
23+
- name: Post-processing
24+
run: ./scripts/prepareVideo.sh
25+
- uses: hkusu/s3-upload-action@v2
26+
id: upload # specify some ID for use in subsequent steps
27+
with:
28+
aws-access-key-id: ${{ vars.AWS_KEY_ID }}
29+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
30+
aws-region: 'eu-central-1'
31+
aws-bucket: ${{ vars.AWS_BUCKET }}
32+
file-path: './ui-test.gif'
33+
content-type: image/gif
34+
output-file-url: 'true'
35+
- name: Show URL
36+
run: echo '${{ steps.upload.outputs.file-url }}'
37+
id: artifact-upload-step
38+
- run: echo '![test](${{ steps.upload.outputs.file-url }})' >> $GITHUB_STEP_SUMMARY

.npmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

.releaserc

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"branches": [
3+
"release",
4+
{
5+
"name": "beta",
6+
"prerelease": true
7+
}
8+
],
9+
"plugins": [
10+
"@semantic-release/commit-analyzer",
11+
"semantic-release-export-data",
12+
"@semantic-release/changelog",
13+
[
14+
"@semantic-release/npm",
15+
{
16+
"npmPublish": false
17+
}
18+
],
19+
[
20+
"@semantic-release/git",
21+
{
22+
"assets": [
23+
"package.json",
24+
"yarn.lock"
25+
]
26+
}
27+
]
28+
]
29+
}

.travis.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
FROM node:19.8.1-bullseye-slim
1+
FROM node:20
22

33
RUN DEBIAN_FRONTEND="noninteractive" apt-get update \
4-
&& apt-get install -y --no-install-recommends nano ffmpeg xvfb git-core tmux locales mosquitto x11vnc
4+
&& apt-get install -y --no-install-recommends ca-certificates nano ffmpeg xvfb git-core tmux locales mosquitto x11vnc
55
RUN apt-get install -yq --no-install-recommends libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 libnss3
66

77
# Generate locales for TMUX
@@ -12,6 +12,5 @@ ENV LC_ALL en_US.UTF-8
1212

1313
CMD /bin/bash
1414

15-
COPY cloneBuildAndTest.sh ./
1615
VOLUME /app
1716
EXPOSE 5900

Readme.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
[![Build status](https://ci.appveyor.com/api/projects/status/c35tkm29rm4m5364/branch/master?svg=true)](https://ci.appveyor.com/project/thomasnordquist/mqtt-explorer/branch/master)
77
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/47b26e03fce543ceac7914214482334a)](https://app.codacy.com/app/thomasnordquist/MQTT-Explorer?utm_source=github.com&utm_medium=referral&utm_content=thomasnordquist/MQTT-Explorer&utm_campaign=Badge_Grade_Dashboard)
88

9-
| | | |
10-
|:---:|:---:|:---:|
11-
|[![screen_composite](https://mqtt-explorer.com/img/screen-composite_small.png)](https://mqtt-explorer.com/img/screen-composite.png)|[![screen2_small](https://mqtt-explorer.com/img/screen2_small.png)](https://mqtt-explorer.com/img/screen2.png)|[![screen3_small](https://mqtt-explorer.com/img/screen3_small.png)](https://mqtt-explorer.com/img/screen3.png)|
9+
| | | |
10+
| :---------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------: |
11+
| [![screen_composite](https://mqtt-explorer.com/img/screen-composite_small.png)](https://mqtt-explorer.com/img/screen-composite.png) | [![screen2_small](https://mqtt-explorer.com/img/screen2_small.png)](https://mqtt-explorer.com/img/screen2.png) | [![screen3_small](https://mqtt-explorer.com/img/screen3_small.png)](https://mqtt-explorer.com/img/screen3.png) |
1212

1313
# The App has moved to [mqtt-explorer.com](https://mqtt-explorer.com)
14+
1415
MQTT Explorer is a comprehensive and easy-to-use MQTT Client.
1516
Downloads can be found at the link above.
1617

@@ -29,6 +30,7 @@ yarn start
2930
## Develop
3031

3132
Launch Application
33+
3234
```bash
3335
npm install -g yarn
3436
yarn
@@ -63,6 +65,15 @@ npm run build
6365
node dist/src/spec/webdriverio.js
6466
```
6567

68+
## Create a release
69+
70+
Create a PR to `release` branch.
71+
There needs to be a "feat: some new feature" or "fix: some bugfix" commit for a new release to be created
72+
73+
## Create a beta release
74+
75+
Create a PR to `beta` branch. A "feat" or "fix" commit is necessary to create a new version.
76+
6677
## Write docs
6778

6879
```

docker/cloneBuildAndTest.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
#!/bin/bash
22
set -e
33

4-
git clone https://github.com/thomasnordquist/MQTT-Explorer.git /app
5-
cd /app
6-
git checkout travis-ui-tests
7-
84
yarn install --frozen-lockfile
95
yarn build
106

package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{
22
"name": "MQTT-Explorer",
3-
"version": "0.4.0-beta4",
3+
"version": "0.4.0-beta.2",
44
"description": "Explore your message queues",
55
"main": "dist/src/electron.js",
66
"engines": {
77
"node": ">=18"
88
},
9+
"private": "true",
910
"scripts": {
1011
"start": "electron .",
1112
"test": "yarn test:app && yarn test:backend",
@@ -78,6 +79,9 @@
7879
"@babel/runtime": "^7.17.2",
7980
"@cspell/dict-typescript": "^3.1.2",
8081
"@electron/notarize": "^2.3.0",
82+
"@semantic-release/changelog": "^6.0.3",
83+
"@semantic-release/commit-analyzer": "^12.0.0",
84+
"@semantic-release/git": "^10.0.1",
8185
"@types/chai": "^4.1.7",
8286
"@types/fs-extra": "8",
8387
"@types/lowdb": "^1.0.6",
@@ -100,6 +104,8 @@
100104
"playwright": "^1.43.0",
101105
"prettier": "^3.2.5",
102106
"redux-thunk": "^2.3.0",
107+
"semantic-release": "^23.0.8",
108+
"semantic-release-export-data": "^1.0.1",
103109
"source-map-support": "^0.5.9",
104110
"ts-node": "^10.9.2",
105111
"tslint": "^6.1.3",
@@ -125,4 +131,4 @@
125131
"uuid": "^8.3.2",
126132
"yarn-run-all": "^3.1.1"
127133
}
128-
}
134+
}

package.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as dotProp from 'dot-prop'
55

66
const linuxAppImage: builder.CliOptions = {
77
x64: true,
8-
ia32: true,
8+
ia32: false,
99
armv7l: true,
1010
arm64: false,
1111
projectDir: './build/clean',
@@ -50,9 +50,9 @@ const winAppx: builder.CliOptions = {
5050

5151
const mac: builder.CliOptions = {
5252
x64: true,
53-
ia32: true,
53+
ia32: false,
5454
armv7l: false,
55-
arm64: false,
55+
arm64: true,
5656
projectDir: './build/clean',
5757
publish: 'always',
5858
}

scripts/uiTests.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,4 @@ tmux send-keys -t record q
5959
# Ensure video is written
6060
sleep 5
6161

62-
# Process the video
63-
./scripts/prepareVideo.sh
64-
6562
exit $TEST_EXIT_CODE

0 commit comments

Comments
 (0)