Skip to content

Commit ba89d57

Browse files
committed
chore(ci): add semantic-release
1 parent cccc52a commit ba89d57

File tree

4 files changed

+3524
-71
lines changed

4 files changed

+3524
-71
lines changed

.github/workflows/test.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Tests
1+
name: Test + Release
22
on: [push]
33
jobs:
44
e2e-run-firefox:
@@ -41,3 +41,21 @@ jobs:
4141
env:
4242
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
4343
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
45+
release:
46+
runs-on: ubuntu-latest
47+
container:
48+
image: cypress/browsers:node12.14.1-chrome83-ff77
49+
needs: [e2e-run-chrome, e2e-run-firefox]
50+
steps:
51+
- name: Checkout
52+
uses: actions/checkout@v1
53+
- name: Use Node.js
54+
uses: actions/setup-node@v1
55+
- run: yarn
56+
- name: Semantic Release
57+
uses: cycjimmy/semantic-release-action@v2
58+
env:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
61+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

frontend/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { lockKeyboard } from './lock-keyboard'
22
import { startVideo } from './video'
33
import { startControls } from './controls'
4-
import { version, repository } from '../../package.json'
4+
import { version, homepage } from '../../package.json'
55
import log from './log'
66

7-
log.info(`Welcome to Pilo v${version}! Please report any bugs on the <a href="${repository}">GitHub repo</a>.`)
7+
log.info(`Welcome to Pilo v${version}! Please report any bugs on the <a href="${homepage}">GitHub repo</a>.`)
88

99
lockKeyboard()
1010
startVideo()

package.json

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.0.0-development",
44
"description": "RPi-powered lights-out management for servers. Remotely control the keyboard, power, and see the screen of a server.",
55
"bin": "./server/dist/index.js",
6-
"repository": "https://github.com/flotwig/pilo",
6+
"repository": "https://github.com/flotwig/pilo.git",
77
"homepage": "https://github.com/flotwig/pilo",
88
"author": "Zach Bloomquist <[email protected]>",
99
"license": "AGPL-3.0-only",
@@ -18,12 +18,36 @@
1818
"./frontend/dist",
1919
"./server/dist"
2020
],
21+
"release": {
22+
"plugins": [
23+
"@semantic-release/commit-analyzer",
24+
"@semantic-release/release-notes-generator",
25+
"@semantic-release/github",
26+
[
27+
"@semantic-release/npm",
28+
{
29+
"npmPublish": false
30+
}
31+
],
32+
[
33+
"@semantic-release/exec",
34+
{
35+
"prepareCmd": "yarn pack --filename release.tar.gz",
36+
"publishCmd": "npm publish ./release.tar.gz"
37+
}
38+
]
39+
]
40+
},
2141
"scripts": {
2242
"start": "yarn workspace frontend start & yarn workspace server start",
2343
"clean": "yarn workspace frontend clean & yarn workspace server clean",
2444
"build": "yarn workspace frontend build & yarn workspace server build",
2545
"prepack": "yarn clean && yarn build && yarn prepare:pkg",
2646
"prepare:pkg": "node ./prepare-pkg.js",
27-
"postpack": "rm package.json && mv package.json.bak package.json"
47+
"postpublish": "rm package.json && mv package.json.bak package.json"
48+
},
49+
"devDependencies": {
50+
"@semantic-release/exec": "^5.0.0",
51+
"semantic-release": "^17.1.1"
2852
}
2953
}

0 commit comments

Comments
 (0)