Skip to content

Commit

Permalink
chore: github action for common workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
zernonia committed Dec 13, 2024
1 parent 93a5856 commit 166fe8a
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 130 deletions.
37 changes: 37 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Setup
description: Installs Node and caches pnpm.

runs:
using: composite

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 18

- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 9
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
shell: bash
run: pnpm i --frozen-lockfile
62 changes: 4 additions & 58 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,8 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 18

- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 9
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm i --frozen-lockfile
- name: Setup (Install node & pnpm)
uses: ./.github/actions/setup

- name: Build
run: pnpm --filter reka-ui build
Expand All @@ -63,35 +36,8 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 18

- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 9
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm i --frozen-lockfile
- name: Setup (Install node & pnpm)
uses: ./.github/actions/setup

- name: Test
run: pnpm test
31 changes: 2 additions & 29 deletions .github/workflows/pkg.pr.new.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,8 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 18

- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 9
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm i --frozen-lockfile
- name: Setup (Install node & pnpm)
uses: ./.github/actions/setup

- name: Build Reka UI and plugins
run: pnpm run build
Expand Down
32 changes: 2 additions & 30 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,8 @@ jobs:
deployments: write
name: Publish to Cloudflare Pages
steps:
- name: Checkout
uses: actions/checkout@v4

# Run a build step here
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 18

- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 9
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm i --frozen-lockfile
- name: Setup (Install node & pnpm)
uses: ./.github/actions/setup

- name: Build Reka UI
run: pnpm --filter reka-ui build
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,8 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version: 18.x
- name: Setup (Install node & pnpm)
uses: ./.github/actions/setup

- run: npx changelogithub
env:
Expand Down
6 changes: 0 additions & 6 deletions packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,6 @@ We would love to have your contributions! All PRs all welcomed! We need help bui
4. Open `http://localhost:6006`
5. Run `pnpm test` to test changes

## Core Team

- [Zernonia](https://github.com/zernonia)
- [Khairul Haaziq](https://github.com/k11q)
- [Mujahid Anuar](https://github.com/mujahidfa)

## Credits

All credits go to these open-source works and resources
Expand Down

0 comments on commit 166fe8a

Please # to comment.