Skip to content

Commit

Permalink
ci: add semantic release
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtek-krysiak committed Jul 2, 2020
1 parent b4a3ec4 commit 3b83f42
Show file tree
Hide file tree
Showing 5 changed files with 3,798 additions and 97 deletions.
29 changes: 11 additions & 18 deletions .github/workflows/push.yml
Expand Up @@ -81,27 +81,20 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: '10.x'
- uses: filipstefansson/set-npm-token-action@v1
- uses: actions/cache@v1
id: yarn-cache
with:
token: ${{ secrets.NPM_TOKEN }}
- name: Publish beta
if: contains(github.ref, 'beta')
run: yarn publish --tag beta
- name: Publish
if: "!contains(github.ref, 'beta')"
run: yarn publish
- name: Generate Changelog
# this command extracts info about particular version from the changelog
run: |
awk -v ver=${GITHUB_REF##*/} '
/^## Version / { if (p) { exit }; if ($3 == ver) { p=1; next} } p && NF
' CHANGELOG.md > changelog-message.txt
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node_modules-
- name: Install
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install
- name: Release
with:
body_path: changelog-message.txt
prerelease: contains(github.ref, 'beta')
uses: softprops/action-gh-release@v1
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: yarn release


19 changes: 19 additions & 0 deletions .releaserc
@@ -0,0 +1,19 @@
{
"branches": [
"+([0-9])?(.{+([0-9]),x}).x",
"master",
"next",
"next-major",
{
"name": "beta",
"prerelease": true
}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
"@semantic-release/github",
"@semantic-release/git"
]
}
5 changes: 5 additions & 0 deletions commitlint.config.js
@@ -0,0 +1,5 @@
module.exports = {
extends: [
'@commitlint/config-conventional',
],
}
12 changes: 11 additions & 1 deletion package.json
Expand Up @@ -37,7 +37,12 @@
"gulp-sass": "^4.0.2",
"gulp-uglify": "^3.0.2",
"jsdoc": "^3.6.3",
"mocha": "^6.2.0"
"mocha": "^6.2.0",
"semantic-release": "^17.0.7",
"@semantic-release/git": "^9.0.0",
"husky": "^4.2.5",
"@commitlint/cli": "^8.3.5",
"@commitlint/config-conventional": "^8.3.4"
},
"peerDependencies": {
"react": "^16.0.0",
Expand All @@ -53,5 +58,10 @@
"underscore": "^1.9.1",
"vue-docgen-api": "^3.22.0",
"vue2-ace-editor": "^0.0.13"
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
}
}

0 comments on commit 3b83f42

Please sign in to comment.