Skip to content

Commit 2039298

Browse files
feat: workflow to commit dist folder for release (#9)
1 parent 1a8872a commit 2039298

File tree

4 files changed

+92
-1
lines changed

4 files changed

+92
-1
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist/** linguist-generated=true
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Build and Release
2+
3+
on:
4+
release:
5+
types: [created]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-and-commit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: '20'
20+
21+
- name: Install dependencies
22+
run: yarn install
23+
24+
- name: Build project
25+
run: yarn build
26+
27+
- name: Commit dist folder
28+
run: |
29+
git config --local user.email "[email protected]"
30+
git config --local user.name "GitHub Action"
31+
git add dist
32+
git commit -m "Build dist folder for release ${{ github.ref }}" || echo "No changes to commit"
33+
git push
34+
35+
- name: Update release with dist folder
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
run: |
39+
gh release upload ${{ github.ref }} dist/** --clobber

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
# production
1212
/build
13-
/dist
1413
src/styles/tailwind.output.css
1514

1615
# Storybook

README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,58 @@
22

33
**An open-source UI component library for the Bitcoin Dev Project (BDP) Apps**
44

5+
## Installation
6+
7+
To install the BDP-UI library, you can use the following command:
8+
9+
```bash
10+
yarn add github:bitcoin-dev-project/bdp-ui
11+
```
12+
or
13+
```bash
14+
npm install github:bitcoin-dev-project/bdp-ui
15+
```
16+
17+
## Usage
18+
19+
Once installed, you can import the components you need from the library:
20+
21+
note: you can set up an entry point in your project config to `/dist` to fix the autocomplete and linting issues. Or in typescript you can use the `paths` property in tsconfig.json to fix the import paths.
22+
23+
```json
24+
{
25+
"compilerOptions": {
26+
"baseUrl": ".",
27+
"paths": {
28+
"bdp-ui/*": ["./node_modules/bdp-ui/dist/*"]
29+
}
30+
}
31+
}
32+
```
33+
34+
### Components
35+
36+
```jsx
37+
import { Button } from 'bdp-ui';
38+
39+
function App() {
40+
return (
41+
<Button>Hello, World!</Button>
42+
);
43+
}
44+
```
45+
46+
### Icons
47+
```jsx
48+
import { GithubIcon } from 'bdp-ui/icons';
49+
50+
function App() {
51+
return (
52+
<GithubIcon className="w-[40px] text-black" />
53+
);
54+
}
55+
```
56+
557
## License
658

759
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details

0 commit comments

Comments
 (0)