Skip to content

Commit fe04830

Browse files
Merge pull request #190 from commitd/stuarthendren/semrel
Adds semantic release
2 parents df19835 + b40939f commit fe04830

File tree

6 files changed

+34939
-24903
lines changed

6 files changed

+34939
-24903
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 52 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
name: release
22

3+
name: build
4+
35
on:
4-
release:
5-
types: [created]
6+
push:
7+
branches:
8+
- main
9+
- beta
610

711
jobs:
8-
release:
9-
name: Build and publish
12+
build:
13+
name: Full CI
1014
runs-on: ubuntu-latest
1115

1216
steps:
1317
- name: Checkout repo
1418
uses: actions/checkout@v2
19+
with:
20+
fetch-depth: 0
1521

1622
- name: Set up Node
1723
uses: actions/setup-node@v1
@@ -29,10 +35,29 @@ jobs:
2935
if: ${{ env.ACT }}
3036
run: npm install
3137

32-
- name: Publish Package
33-
run: npm publish --access=public
38+
- name: Lint
39+
run: npm run lint
40+
41+
- name: Test
42+
run: npm test -- --ci --coverage --maxWorkers=2
43+
44+
- name: Build
45+
run: npm run build
46+
47+
- name: Build Storybook
48+
run: npm run build-storybook -- --quiet
49+
50+
- name: SonarCloud Scan
51+
uses: sonarsource/sonarcloud-github-action@master
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
SONAR_TOKEN: ${{ secrets.SONAR_CLOUD_TOKEN }}
55+
56+
- name: Release
3457
env:
35-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
60+
run: npx semantic-release
3661

3762
- name: Publish Docs
3863
run: npm run deploy-storybook -- --ci

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx --no-install commitlint --edit ""

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=commitd_components&metric=coverage&token=aa002ca75e2f3a6d028af9074bceeda1ffa2f9f7)](https://sonarcloud.io/dashboard?id=commitd_components)
77
![GitHub repo size](https://img.shields.io/github/repo-size/commitd/components)
88
[![Storybook](https://cdn.jsdelivr.net/gh/storybookjs/brand@master/badge/badge-storybook.svg)](https://committed.software/components)
9+
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
910

1011
For documentation see https://committed.software/components
1112

0 commit comments

Comments
 (0)