Skip to content

Commit

Permalink
chore: update workflows (#12)
Browse files Browse the repository at this point in the history
* refactor: attempt at reducing bundle size

* chore: update workflow

* Create dirty-kids-grin.md

* chore: update workflows
  • Loading branch information
Ryan-Zayne authored Jun 19, 2024
1 parent 2f18f3b commit a5e88c3
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 16 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/lint-and-type.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: Lint and Type

on:
pull_request:
push:
branches: [main]
pull_request:
types: [opened, synchronize]

permissions:
contents: read

jobs:
build:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
name: Publish
name: Release and Publish
on:
workflow_run:
workflows: [Lint and Type]
branches: [main]
types: [completed]
push:
branches:
- main
# workflow_run:
# workflows: [Lint and Type]
# branches: [main]
# types: [completed]

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

Expand All @@ -12,26 +15,29 @@ permissions:
pull-requests: write

jobs:
publish:
release:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
node-version: [20.x]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Checkout repo
uses: actions/checkout@v4
with:
# This makes Actions fetch all Git history so that Changesets
# can generate changelogs with the correct commits.
fetch-depth: 0

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 9

- name: Setup Node.js
- name: Setup Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: "https://registry.npmjs.org"
cache: "pnpm"
cache-dependency-path: "**/pnpm-lock.yaml"

Expand All @@ -40,8 +46,7 @@ jobs:
pnpm install --frozen-lockfile
pnpm build
- name: Create Release Pull Request or Publish
id: changesets
- name: Create Release Pull Request or Publish to npm
uses: changesets/action@v1
with:
publish: pnpm release
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"test:lint": "eslint src/**/*.ts --max-warnings 10 --report-unused-disable-directives",
"build": "tsup",
"build:dev": "tsup --watch",
"release": "pnpm build && changelogen && changeset publish"
"version-package": "changeset version",
"release": "changeset publish"
},
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down

0 comments on commit a5e88c3

Please sign in to comment.