-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5c3361d
Showing
8 changed files
with
141 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: 'Split packages' | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
packages_split: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
package: | ||
- local_path: 'packages/button' | ||
github_account: 'unlock-sh' | ||
github_repository: 'button-component' | ||
deploy_key: 'BUTTON_DEPLOY_KEY' | ||
target_branch: 'main' | ||
- local_path: 'packages/input' | ||
github_account: 'unlock-sh' | ||
github_repository: 'input-component' | ||
deploy_key: 'INPUT_DEPLOY_KEY' | ||
target_branch: 'main' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- if: "!startsWith(github.ref, 'refs/tags/')" | ||
name: "Update package repository" | ||
uses: alphpaca/[email protected] | ||
with: | ||
package_path: '${{ matrix.package.local_path }}' | ||
ssh_private_key: ${{ secrets[matrix.package.deploy_key] }} | ||
git_username: 'unlock-sh' | ||
git_email: '[email protected]' | ||
repository_owner: "${{ matrix.package.github_account }}" | ||
repository_name: "${{ matrix.package.github_repository }}" | ||
target_branch: "${{ matrix.package.target_branch }}" | ||
|
||
- if: "startsWith(github.ref, 'refs/tags/')" | ||
name: Extract tag | ||
id: extract_tag | ||
run: echo ::set-output name=TAG::${GITHUB_REF/refs\/tags\//} | ||
|
||
- if: "startsWith(github.ref, 'refs/tags/')" | ||
name: "Create package tag" | ||
uses: alphpaca/[email protected] | ||
|
||
with: | ||
package_path: '${{ matrix.package.local_path }}' | ||
ssh_private_key: ${{ secrets[matrix.package.deploy_key] }} | ||
git_username: 'unlock-sh' | ||
git_email: '[email protected]' | ||
repository_owner: "${{ matrix.package.github_account }}" | ||
repository_name: "${{ matrix.package.github_repository }}" | ||
target_branch: "${{ matrix.package.target_branch }}" | ||
tag: ${{ steps.extract_tag.outputs.TAG }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "@acme/root", | ||
"version": "1.0.0", | ||
"private": true, | ||
"workspaces": [ | ||
"packages/*", | ||
"apps/*", | ||
"services/*" | ||
], | ||
"dependencies": { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Publish release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from "react"; | ||
const Button = ({ onClick, children, isSelected }) => ( | ||
<button | ||
style={{ | ||
backgroundColor: isSelected ? "bg-black" : "bg-white", | ||
color: isSelected ? "text-white" : "text-black", | ||
}} | ||
onClick={onClick} | ||
> | ||
{children} | ||
</button> | ||
); | ||
export default Button; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "@acme/button", | ||
"version": "1.0.0", | ||
"description": "A very simple button", | ||
"dependencies": { | ||
"react": "^18.2.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Publish release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from "react"; | ||
const Input = () => ( | ||
<input | ||
style={{ | ||
border: 0, | ||
padding: "12px 24px", | ||
margin: "12px", | ||
borderRadius: "3px" | ||
}} | ||
/> | ||
); | ||
export default Input; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "@acme/input", | ||
"version": "1.0.0", | ||
"description": "A very simple input field", | ||
"dependencies": { | ||
"react": "^18.2.0" | ||
} | ||
} |