Skip to content

Commit 76ed184

Browse files
committed
chore: Implement automatic semantic release
1 parent b769255 commit 76ed184

2 files changed

Lines changed: 34 additions & 7 deletions

File tree

.github/workflows/release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ jobs:
2020
node-version: '12.x'
2121
registry-url: 'https://registry.npmjs.org'
2222

23-
- name: Prepare git user
23+
- name: Build
2424
run: |
25-
git config --global user.name "Dan Carbonell"
26-
git config --global user.email "dan1525@gmail.com"
25+
npm run build:ci
2726
2827
- name: Publish release to NPM
29-
run: npm version patch
3028
env:
31-
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTOMATION_TOKEN }}
29+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
30+
NPM_TOKEN: ${{ secrets.NPM_AUTOMATION_TOKEN }}
31+
run: npx semantic-release

package.json

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,37 @@
1414
"copy-assets": "echo '\u001b[34mℹ\u001b[0m Copying assets to distributed directory' && cp -R src/assets dist/assets && echo '\u001b[32m✓\u001b[0m Finished copying assets'",
1515
"copy-styles": "echo '\u001b[34mℹ\u001b[0m Copying scss files to distributed directory' && cp -R src/styles dist/scss && echo '\u001b[32m✓\u001b[0m Finished copying styles'",
1616
"lint": "stylelint '**/*.scss' --max-warnings 0",
17-
"preversion": "yarn && yarn lint && yarn build",
18-
"postversion": "git push && git push --tags && npm publish",
17+
"build:ci": "yarn && yarn lint && yarn build",
1918
"start": "yarn build && sass --watch src/styles/index.scss dist/css/index.css"
2019
},
20+
"release": {
21+
"branches": [
22+
"master"
23+
],
24+
"dryRun": true,
25+
"plugins": [
26+
"@semantic-release/commit-analyzer",
27+
"@semantic-release/release-notes-generator",
28+
[
29+
"@semantic-release/npm",
30+
{
31+
"npmPublish": false
32+
}
33+
],
34+
[
35+
"@semantic-release/github"
36+
],
37+
[
38+
"@semantic-release/git",
39+
{
40+
"assets": [
41+
"package.json"
42+
],
43+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
44+
}
45+
]
46+
]
47+
},
2148
"devDependencies": {
2249
"sass": "^1.39.2",
2350
"stylelint": "^13.13.1",

0 commit comments

Comments
 (0)