Skip to content

Commit

Permalink
refactored: changesets ci flow on push to main
Browse files Browse the repository at this point in the history
  • Loading branch information
xanderjl committed Nov 19, 2024
1 parent 990902c commit 6b07913
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 43 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/changesets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Changesets
on:
push:
branches:
- main
env:
CI: true
PNPM_CACHE_FOLDER: .pnpm-store
jobs:
version:
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- name: checkout code repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: setup node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: install pnpm
run: npm i pnpm@latest -g
- name: setup pnpm config
run: pnpm config set store-dir $PNPM_CACHE_FOLDER
- name: Setup npmrc
run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > .npmrc
- name: install dependencies
run: pnpm install
- name: create and publish versions
uses: changesets/action@v1
with:
version: pnpm ci:version
commit: "chore: update versions"
title: "chore: update versions"
publish: pnpm ci:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Setup npmrc
run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > .npmrc

- name: Install dependencies
run: pnpm install

Expand Down
43 changes: 0 additions & 43 deletions .github/workflows/publish.yml

This file was deleted.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"build:example": "pnpm --filter @tangled3/example-react build",
"build:example-next": "pnpm --filter @tangled3/example-next build",
"clean": "pnpm exec clean",
"ci:publish": "pnpm publish -r --access=restricted",
"prepare": "husky && husky install",
"lint": "eslint packages",
"lint:fix": "eslint packages --fix",
Expand Down

0 comments on commit 6b07913

Please sign in to comment.