Skip to content

Commit

Permalink
chore: update GH actions and add release job
Browse files Browse the repository at this point in the history
  • Loading branch information
duniul committed Jul 7, 2023
1 parent ec5b506 commit b131647
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 49 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/changesets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: 'Manage changesets'
on:
workflow_dispatch:
push:
branches:
- main

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

jobs:
main:
name: Publish changed packages
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false

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

- name: 📦 Install dependencies
run: yarn install

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

on:
workflow_dispatch:
push:

jobs:
build:
name: 🧱 Build
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false

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

- name: 📦 Install dependencies
run: yarn install

- name: 🧱 Build project
run: yarn build

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

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

steps:
- name: 🏗 Setup repo
uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false

- name: 🏗 Setup Node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: yarn

- name: 📦 Install dependencies
run: yarn install

- name: 🧱 Build project
run: yarn build
16 changes: 0 additions & 16 deletions .github/workflows/test-linux.yml

This file was deleted.

16 changes: 0 additions & 16 deletions .github/workflows/test-macos.yml

This file was deleted.

16 changes: 0 additions & 16 deletions .github/workflows/test-windows.yml

This file was deleted.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
"test": "vitest",
"prepare": "yarn build",
"lint": "rome check src && prettier --check src",
"lint:fix": "rome check --apply src && prettier --write src"
"lint:fix": "rome check --apply src && prettier --write src",
"version": "changeset version",
"release": "changeset publish"
},
"dependencies": {
"arg": "^5.0.1",
Expand Down

0 comments on commit b131647

Please sign in to comment.