Skip to content

Commit

Permalink
chore(ci): add semantic-release
Browse files Browse the repository at this point in the history
  • Loading branch information
flotwig committed Aug 20, 2020
1 parent cccc52a commit ba89d57
Show file tree
Hide file tree
Showing 4 changed files with 3,524 additions and 71 deletions.
20 changes: 19 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Tests
name: Test + Release
on: [push]
jobs:
e2e-run-firefox:
Expand Down Expand Up @@ -41,3 +41,21 @@ jobs:
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

release:
runs-on: ubuntu-latest
container:
image: cypress/browsers:node12.14.1-chrome83-ff77
needs: [e2e-run-chrome, e2e-run-firefox]
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Use Node.js
uses: actions/setup-node@v1
- run: yarn
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 2 additions & 2 deletions frontend/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { lockKeyboard } from './lock-keyboard'
import { startVideo } from './video'
import { startControls } from './controls'
import { version, repository } from '../../package.json'
import { version, homepage } from '../../package.json'
import log from './log'

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

lockKeyboard()
startVideo()
Expand Down
28 changes: 26 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0-development",
"description": "RPi-powered lights-out management for servers. Remotely control the keyboard, power, and see the screen of a server.",
"bin": "./server/dist/index.js",
"repository": "https://github.com/flotwig/pilo",
"repository": "https://github.com/flotwig/pilo.git",
"homepage": "https://github.com/flotwig/pilo",
"author": "Zach Bloomquist <pilo@chary.us>",
"license": "AGPL-3.0-only",
Expand All @@ -18,12 +18,36 @@
"./frontend/dist",
"./server/dist"
],
"release": {
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/github",
[
"@semantic-release/npm",
{
"npmPublish": false
}
],
[
"@semantic-release/exec",
{
"prepareCmd": "yarn pack --filename release.tar.gz",
"publishCmd": "npm publish ./release.tar.gz"
}
]
]
},
"scripts": {
"start": "yarn workspace frontend start & yarn workspace server start",
"clean": "yarn workspace frontend clean & yarn workspace server clean",
"build": "yarn workspace frontend build & yarn workspace server build",
"prepack": "yarn clean && yarn build && yarn prepare:pkg",
"prepare:pkg": "node ./prepare-pkg.js",
"postpack": "rm package.json && mv package.json.bak package.json"
"postpublish": "rm package.json && mv package.json.bak package.json"
},
"devDependencies": {
"@semantic-release/exec": "^5.0.0",
"semantic-release": "^17.1.1"
}
}
Loading

0 comments on commit ba89d57

Please sign in to comment.