Skip to content

Commit

Permalink
feat: add semantic-release setup for automatic deployments (#271)
Browse files Browse the repository at this point in the history
* feat: add semantic-release setup for automatic deployments

This adds the setup for semantic-release. master/beta/alpha branch changes will get deployed to npm
with version depending on the commit message

* chore: add PR linter

* chore: add more events tro trigger the check
  • Loading branch information
matmalkowski authored Oct 19, 2020
1 parent ed0c1d0 commit 4911227
Show file tree
Hide file tree
Showing 5 changed files with 2,664 additions and 72 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release
on:
push:
branches:
- master
- alpha
- beta
jobs:
release:
name: Release
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build the package
run: yarn build
- name: Release
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
16 changes: 16 additions & 0 deletions .github/workflows/semantic_release_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 'Pull Request SemVer lint'
on:
pull_request:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: amannn/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.27.2",
"semantic-release": "^17.2.1",
"spectron": "^11.1.0",
"typescript": "^4.0.3",
"typings-tester": "^0.3.2",
Expand Down
9 changes: 9 additions & 0 deletions release.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
release: {
branches: [
'master',
{ name: 'alpha', prerelease: true },
{ name: 'beta', prerelease: true },
],
},
}
Loading

0 comments on commit 4911227

Please sign in to comment.