Skip to content

Commit

Permalink
chore: setup Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
duniul committed May 11, 2024
1 parent 14a0eef commit 85614fb
Show file tree
Hide file tree
Showing 2 changed files with 114 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/changesets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: 🆕 Release management

on:
workflow_dispatch:
push:
branches:
- main
paths-ignore:
- '.vscode/**'
- 'demo/**'
- '*.md'

concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions:
contents: write
pull-requests: write

jobs:
main:
name: Publish changed packages
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v4

- name: 🏗 Setup pnpm
uses: pnpm/action-setup@v4

- name: 🏗 Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: pnpm

- name: 📦 Install dependencies
run: pnpm install

- name: 🆕 Publish to npm or create release PR
id: changesets
uses: changesets/action@v1
with:
title: '🆕 Upcoming release'
commit: 'chore: bump version'
version: pnpm run version
publish: pnpm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
65 changes: 65 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: 🕵️ Checks

on:
workflow_dispatch:
push:
paths-ignore:
- '.vscode/**'
- 'demo/**'
- '*.md'

permissions:
contents: read

jobs:
build:
name: 🧱 Build
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v4

- name: 🏗 Setup pnpm
uses: pnpm/action-setup@v4

- name: 🏗 Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: pnpm

- name: 📦 Install dependencies
run: pnpm install

- name: 🧱 Build project
run: pnpm build

test:
name: 🧪 Test
strategy:
matrix:
os: [ubuntu-latest]
node-version: [18.x, 20.x]

runs-on: ${{ matrix.os }}

steps:
- name: 🏗 Setup repo
uses: actions/checkout@v4

- name: 🏗 Setup pnpm
uses: pnpm/action-setup@v4

- name: 🏗 Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: pnpm

- name: 📦 Install dependencies
run: pnpm install

- name: 🧪 Run tests
run: pnpm test

0 comments on commit 85614fb

Please sign in to comment.