Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
PhiloNL committed Oct 30, 2022
0 parents commit 5c3361d
Show file tree
Hide file tree
Showing 8 changed files with 141 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/release.yml
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 }}
12 changes: 12 additions & 0 deletions package.json
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": {
}
}
15 changes: 15 additions & 0 deletions packages/button/.github/workflows/release.yml
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
13 changes: 13 additions & 0 deletions packages/button/index.js
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;
8 changes: 8 additions & 0 deletions packages/button/package.json
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"
}
}
15 changes: 15 additions & 0 deletions packages/input/.github/workflows/release.yml
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
12 changes: 12 additions & 0 deletions packages/input/index.js
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;
8 changes: 8 additions & 0 deletions packages/input/package.json
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"
}
}

0 comments on commit 5c3361d

Please sign in to comment.