Skip to content

Commit

Permalink
Merge pull request #92 from dotkom/feat/versioning
Browse files Browse the repository at this point in the history
Automatic versioning and releases
  • Loading branch information
oleast authored Nov 19, 2020
2 parents e6584aa + f81cdad commit 8205a64
Show file tree
Hide file tree
Showing 7 changed files with 2,983 additions and 126 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@

name: Deploy

on:
push:
branches:
- master
tags:
- '*'
workflow_dispatch:

jobs:

deploy:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -42,4 +40,4 @@ jobs:
username: ${{ secrets.DEPLOY_USERNAME }}
key: ${{ secrets.DEPLOY_KEY }}
script: source ${{ secrets.DEPLOY_SCRIPT_LOCATION }}
timout: 600s
timout: 600s
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: release
on:
push:
branches:
- master

jobs:
release:
if: "!contains(github.event.head_commit.message, '[skip:ci]')"
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false

- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: yarn

- name: Release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_AUTHOR_NAME: 'dotkom-build'
GIT_COMMITTER_NAME: 'dotkom-build'
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_EMAIL: [email protected]
5 changes: 5 additions & 0 deletions .huskyrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
}
25 changes: 25 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"branches": [
"master"
],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "conventionalcommits"
}
],
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
[
"@semantic-release/git",
{
"assets": [
"package.json"
],
"message": "chore(release): ${nextRelease.version} [skip:ci]\n\n${nextRelease.notes}"
}
],
"@semantic-release/github"
]
}
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {extends: ['@commitlint/config-conventional']}
17 changes: 14 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kvittering",
"version": "0.1.0",
"version": "1.0.0",
"private": true,
"dependencies": {
"@dotkomonline/design-system": "^0.22.0",
Expand Down Expand Up @@ -46,27 +46,38 @@
"lint": "eslint 'src/**/*.{js,jsx,ts,tsx}' --fix",
"tsc": "tsc --noEmit",
"test": "jest --watch",
"test:ci": "jest --ci --coverage"
"test:ci": "jest --ci --coverage",
"release": "semantic-release"
},
"browserslist": [
"> 1% in NO",
"not ie 11"
],
"devDependencies": {
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@semantic-release/commit-analyzer": "^8.0.1",
"@semantic-release/git": "^9.0.0",
"@semantic-release/github": "^7.2.0",
"@semantic-release/npm": "^7.0.8",
"@semantic-release/release-notes-generator": "^9.0.1",
"@testing-library/jest-dom": "^5.11.6",
"@testing-library/react": "^11.1.2",
"@typescript-eslint/eslint-plugin": "^4.5.0",
"@typescript-eslint/parser": "^4.5.0",
"babel-jest": "^26.6.3",
"conventional-changelog-conventionalcommits": "^4.5.0",
"eslint": "^7.11.0",
"eslint-config-prettier": "^6.13.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.21.4",
"eslint-plugin-react-hooks": "^4.1.2",
"husky": "^4.3.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^26.6.3",
"next-page-tester": "^0.5.0",
"prettier": "^2.1.2",
"react-test-renderer": "^17.0.1"
"react-test-renderer": "^17.0.1",
"semantic-release": "^17.2.3"
}
}
Loading

1 comment on commit 8205a64

@vercel
Copy link

@vercel vercel bot commented on 8205a64 Nov 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.