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 198f03e commit 7879d53
Show file tree
Hide file tree
Showing 2 changed files with 120 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/changesets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
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
with:
version: 8

- 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 }}
69 changes: 69 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
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
with:
version: 8

- 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, macos-latest, windows-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
with:
version: 8

- 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 7879d53

Please sign in to comment.