Skip to content

Commit

Permalink
build(shared): setup changesets action to create releases
Browse files Browse the repository at this point in the history
  • Loading branch information
sdorra committed Jul 13, 2024
1 parent ee60216 commit 9b6195f
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Release

on:
push:
branches:
- main

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

jobs:
release:
name: Release
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 2

- uses: pnpm/action-setup@v3
with:
version: 8

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Create Release Pull Request or Publish to npm
# https://github.com/changesets/action
uses: changesets/action@v1
with:
version: pnpm version-packages
publish: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
"commitlint": "commitlint --edit",
"build": "turbo build",
"test": "turbo test",
"dev": "turbo dev"
"dev": "turbo dev",
"initial-build": "pnpm build --filter=@content-collections/cli && pnpm install && pnpm build",
"release": "pnpm initial-build && changeset publish",
"version-packages": "changeset version"
},
"devDependencies": {
"@changesets/changelog-github": "^0.5.0",
Expand Down

0 comments on commit 9b6195f

Please sign in to comment.