Skip to content

Commit

Permalink
added changeset release workflow with github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
dnotes committed Oct 8, 2024
1 parent 884f8b5 commit 99fe7bf
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 3 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release

on:
push:
branches:
- main

jobs:
release:
permissions:
contents: write
pull-requests: write
issues: write
timeout-minutes: 20
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: pnpm/action-setup@v4
with:
version: 9

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Build
run: pnpm build

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: pnpm changeset:release
version: pnpm changeset:version
commit: "chore: new release"
title: "chore: new release candidate"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"main": "index.js",
"scripts": {
"changeset": "changeset",
"publish": "changeset publish",
"version": "changeset version",
"changeset:release": "changeset publish",
"changeset:version": "changeset version",
"build": "pnpm -r build",
"test:watch": "vitest",
"test": "vitest --run"
Expand Down
2 changes: 1 addition & 1 deletion packages/svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"dev": "vite dev",
"build": "vite build && npm run package",
"build:package": "vite build && npm run package",
"preview": "vite preview",
"package": "svelte-kit sync && svelte-package && publint",
"prepublishOnly": "npm run package",
Expand Down

0 comments on commit 99fe7bf

Please sign in to comment.