Skip to content

Commit

Permalink
ci: Automate package publishing with Changesets (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
morgsmccauley authored Nov 30, 2023
1 parent cab772c commit 5f61a48
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release Packages

on:
push:
branches:
- main

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

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3

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

- name: Install Dependencies
run: npm ci

- name: Build
run: npm run build

- name: Test
run: npm run test

- name: Create Release Pull Request or Publish to NPM
uses: changesets/action@v1
with:
publish: npm run release
commit: "chore(release): publish packages"
title: "Publish packages"
createGithubReleases: true
env:
GITHUB_TOKEN: ${{ github.token }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"clean": "turbo run clean",
"dev": "turbo run dev",
"demo": "turbo run demo --filter=@near-lake/$npm_config_name",
"test": "turbo run test"
"test": "turbo run test",
"release": "changeset publish"
},
"devDependencies": {
"@changesets/changelog-github": "^0.4.6",
Expand Down

0 comments on commit 5f61a48

Please sign in to comment.