Skip to content

Commit 5c3361d

Browse files
committed
Initial commit
0 parents  commit 5c3361d

File tree

8 files changed

+141
-0
lines changed

8 files changed

+141
-0
lines changed

.github/workflows/release.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: 'Split packages'
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- '*'
9+
10+
jobs:
11+
packages_split:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
package:
17+
- local_path: 'packages/button'
18+
github_account: 'unlock-sh'
19+
github_repository: 'button-component'
20+
deploy_key: 'BUTTON_DEPLOY_KEY'
21+
target_branch: 'main'
22+
- local_path: 'packages/input'
23+
github_account: 'unlock-sh'
24+
github_repository: 'input-component'
25+
deploy_key: 'INPUT_DEPLOY_KEY'
26+
target_branch: 'main'
27+
steps:
28+
- uses: actions/checkout@v2
29+
- if: "!startsWith(github.ref, 'refs/tags/')"
30+
name: "Update package repository"
31+
uses: alphpaca/[email protected]
32+
with:
33+
package_path: '${{ matrix.package.local_path }}'
34+
ssh_private_key: ${{ secrets[matrix.package.deploy_key] }}
35+
git_username: 'unlock-sh'
36+
git_email: '[email protected]'
37+
repository_owner: "${{ matrix.package.github_account }}"
38+
repository_name: "${{ matrix.package.github_repository }}"
39+
target_branch: "${{ matrix.package.target_branch }}"
40+
41+
- if: "startsWith(github.ref, 'refs/tags/')"
42+
name: Extract tag
43+
id: extract_tag
44+
run: echo ::set-output name=TAG::${GITHUB_REF/refs\/tags\//}
45+
46+
- if: "startsWith(github.ref, 'refs/tags/')"
47+
name: "Create package tag"
48+
uses: alphpaca/[email protected]
49+
50+
with:
51+
package_path: '${{ matrix.package.local_path }}'
52+
ssh_private_key: ${{ secrets[matrix.package.deploy_key] }}
53+
git_username: 'unlock-sh'
54+
git_email: '[email protected]'
55+
repository_owner: "${{ matrix.package.github_account }}"
56+
repository_name: "${{ matrix.package.github_repository }}"
57+
target_branch: "${{ matrix.package.target_branch }}"
58+
tag: ${{ steps.extract_tag.outputs.TAG }}

package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "@acme/root",
3+
"version": "1.0.0",
4+
"private": true,
5+
"workspaces": [
6+
"packages/*",
7+
"apps/*",
8+
"services/*"
9+
],
10+
"dependencies": {
11+
}
12+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Publish release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
- name: Release
15+
uses: softprops/action-gh-release@v1

packages/button/index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import React from "react";
2+
const Button = ({ onClick, children, isSelected }) => (
3+
<button
4+
style={{
5+
backgroundColor: isSelected ? "bg-black" : "bg-white",
6+
color: isSelected ? "text-white" : "text-black",
7+
}}
8+
onClick={onClick}
9+
>
10+
{children}
11+
</button>
12+
);
13+
export default Button;

packages/button/package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "@acme/button",
3+
"version": "1.0.0",
4+
"description": "A very simple button",
5+
"dependencies": {
6+
"react": "^18.2.0"
7+
}
8+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Publish release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
- name: Release
15+
uses: softprops/action-gh-release@v1

packages/input/index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import React from "react";
2+
const Input = () => (
3+
<input
4+
style={{
5+
border: 0,
6+
padding: "12px 24px",
7+
margin: "12px",
8+
borderRadius: "3px"
9+
}}
10+
/>
11+
);
12+
export default Input;

packages/input/package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "@acme/input",
3+
"version": "1.0.0",
4+
"description": "A very simple input field",
5+
"dependencies": {
6+
"react": "^18.2.0"
7+
}
8+
}

0 commit comments

Comments
 (0)