Skip to content
This repository was archived by the owner on Apr 7, 2024. It is now read-only.

Commit f643748

Browse files
committed
Add semantic-release support
1 parent 472664c commit f643748

File tree

8 files changed

+223
-107
lines changed

8 files changed

+223
-107
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ babel.config.cjs.js
33
babel.config.esm.js
44
metro.config.js
55
tailwind.config.js
6+
release.config.js
67
jest.config.js
78
jest.setup.js
89
bob.config.js

.github/workflows/check_pr_title.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'Lint PR'
1+
name: Lint PR
22

33
on:
44
pull_request_target:

.github/workflows/release.yml

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,37 @@ jobs:
77
release:
88
name: 🚀 Release
99
runs-on: ubuntu-latest
10+
1011
permissions:
1112
contents: write
13+
issues: write
1214
packages: write
1315
pull-requests: write
16+
1417
steps:
15-
- uses: actions/checkout@v3
16-
- uses: actions/setup-node@v3
18+
- name: 🛒 Checkout code
19+
uses: actions/checkout@v3
20+
with:
21+
fetch-depth: 0
22+
token: ${{ secrets.ADMIN_TOKEN }}
23+
24+
- name: ⚙️ Setup Node.js
25+
uses: actions/setup-node@v3
1726
with:
1827
node-version: 18
19-
- run: yarn install --frozen-lockfile
20-
- run: yarn build
21-
- run: yarn semantic-release
28+
29+
- name: 📦 Install dependencies
30+
run: yarn install --frozen-lockfile
31+
32+
- name: 🏗️ Build
33+
run: yarn build
34+
35+
- name: 🎉 Release
36+
run: yarn semantic-release
2237
env:
23-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
GITHUB_TOKEN: ${{ secrets.ADMIN_TOKEN }}
39+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
40+
GIT_AUTHOR_NAME: ${{ secrets.GIT_NAME }}
41+
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_EMAIL }}
42+
GIT_COMMITTER_NAME: ${{ secrets.GIT_NAME }}
43+
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_EMAIL }}

.github/workflows/test.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,16 @@ jobs:
1313
name: 🛠️ Test
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v3
17-
- uses: actions/setup-node@v3
16+
- name: 🛒 Checkout code
17+
uses: actions/checkout@v3
18+
19+
- name: ⚙️ Setup Node.js
20+
uses: actions/setup-node@v3
1821
with:
1922
node-version: 18
20-
- run: yarn install --frozen-lockfile
21-
- run: yarn test
23+
24+
- name: 📦 Install dependencies
25+
run: yarn install --frozen-lockfile
26+
27+
- name: 🧪 Run tests
28+
run: yarn test

.releaserc.js

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

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-native-smart-graph",
33
"description": "React Native library for creating animated dynamic graphs",
4-
"version": "0.0.1-development",
4+
"version": "0.0.0-development",
55
"author": {
66
"name": "Mateusz Łopaciński",
77
"email": "lop.mateusz.2001@gmail.com"
@@ -19,8 +19,12 @@
1919
"@babel/preset-env": "^7.22.4",
2020
"@babel/runtime": "^7.22.3",
2121
"@react-native-community/eslint-config": "^3.2.0",
22+
"@semantic-release/changelog": "^6.0.3",
23+
"@semantic-release/commit-analyzer": "^10.0.1",
2224
"@semantic-release/git": "^10.0.1",
25+
"@semantic-release/github": "^9.0.3",
2326
"@semantic-release/npm": "^10.0.3",
27+
"@semantic-release/release-notes-generator": "^11.0.3",
2428
"@shopify/react-native-skia": "^0.1.193",
2529
"@tsconfig/react-native": "^3.0.2",
2630
"@types/jest": "^29.5.2",
@@ -50,7 +54,7 @@
5054
"react-native-reanimated": "^3.2.0",
5155
"react-native-svg": "^13.9.0",
5256
"react-test-renderer": "^18.2.0",
53-
"semantic-release": "^21.0.2",
57+
"semantic-release": "^21.0.3",
5458
"syncpack": "^10.1.0",
5559
"ts-jest": "^29.1.0",
5660
"tsc-alias": "^1.8.6",

release.config.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
module.exports = {
2+
branches: [
3+
{ name: 'develop', prerelease: true },
4+
{ name: 'release', prerelease: true },
5+
'main'
6+
],
7+
plugins: [
8+
// Analyzes commit messages and
9+
// determines the version
10+
[
11+
'@semantic-release/commit-analyzer',
12+
{
13+
releaseRules: [
14+
{ type: 'docs', scope: 'README', release: 'patch' },
15+
{ type: 'refactor', release: 'patch' },
16+
{ type: 'style', release: 'patch' },
17+
{ scope: 'no-release', release: false }
18+
],
19+
parserOpts: {
20+
noteKeywords: ['BREAKING CHANGE', 'BREAKING CHANGES']
21+
}
22+
}
23+
],
24+
// Generates a changelog file
25+
['@semantic-release/changelog', { changelogFile: 'CHANGELOG.md' }],
26+
// Builds release notes from commit messages
27+
'@semantic-release/release-notes-generator',
28+
// Commits, tags, and pushes
29+
[
30+
'@semantic-release/git',
31+
{
32+
assets: ['dist', 'package.json', 'CHANGELOG.md'],
33+
message:
34+
'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}'
35+
}
36+
],
37+
// Updates the version
38+
'@semantic-release/npm',
39+
// Creates the release on GitHub
40+
// and posts release notes
41+
'@semantic-release/github'
42+
]
43+
};

0 commit comments

Comments
 (0)