Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release #1

Merged
merged 3 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish

on:
pull_request:
types: [closed]
branches:
- main

jobs:
publish-packages:
name: Publish packages to NPM
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: main
fetch-depth: '0'
token: ${{ secrets.GH_TOKEN }}

- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
with:
branches: 'main'
48 changes: 48 additions & 0 deletions .github/workflows/static-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Static Check

on:
pull_request:
branches:
- develop
- main

jobs:
check:
name: ESLint & Typescript & Test & Build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: '0'

- name: Set node version
uses: actions/setup-node@v3
with:
node-version: 20

- name: Cache dependencies
id: cache
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-node-

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install --immutable

- name: Check Lint
run: yarn lint

- name: Check TypeScript
run: yarn check:type

- name: Test
run: yarn test

- name: Build
run: yarn build
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yarn commitlint --edit $1
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yarn t
1 change: 1 addition & 0 deletions commitlint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default { extends: ['@commitlint/config-conventional'] };
18 changes: 15 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
"types": "lib/typescript/index.d.ts",
"homepage": "https://github.com/mj-studio-library/react-native-styled-system",
"scripts": {
"t": "yarn lint --cache && yarn tsc --noEmit && yarn test",
"t": "yarn lint --cache && yarn check:type && yarn test",
"lint": "eslint src --ext .ts,.tsx,.js,.jsx",
"check:type": "yarn tsc --noEmit",
"test": "jest",
"test:coverage": "jest --coverage",
"release": "zx tool/publish.mjs",
"build": "yarn t && bob build",
"gen": "zx bin/theme-gen.mjs bin/theme.ts --output bin/ret.d.ts"
"gen": "zx bin/theme-gen.mjs bin/theme.ts --output bin/ret.d.ts",
"prepare": "husky"
},
"repository": {
"type": "git",
Expand All @@ -22,19 +24,24 @@
"license": "MIT",
"devDependencies": {
"@chakra-ui/cli": "^2.4.1",
"@commitlint/cli": "^19.1.0",
"@commitlint/config-conventional": "^19.1.0",
"@mj-studio/eslint-config-react": "^1.0.4",
"@testing-library/react-hooks": "^8.0.1",
"@types/jest": "^29.5.12",
"@types/react": "^18.2.65",
"@types/react-test-renderer": "^18",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^8.2.0",
"husky": "^9.0.11",
"jest": "^29.7.0",
"metro-react-native-babel-preset": "^0.77.0",
"prettier": "^3.2.5",
"react": "*",
"react-native": "^0.73.6",
"react-native-builder-bob": "^0.23.2",
"react-test-renderer": "^18.2.0",
"semantic-release": "^23.0.2",
"ts-jest": "^29.1.2",
"typescript": "5.3.3",
"zx": "^7.2.3"
Expand Down Expand Up @@ -67,5 +74,10 @@
"module",
"typescript"
]
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
}
}
}
7 changes: 7 additions & 0 deletions release.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* @type {import('semantic-release').GlobalConfig}
*/
module.exports = {
branches: ["main"],
repositoryUrl: 'https://github.com/mj-studio-library/react-native-styled-system'
};
Loading
Loading