Skip to content

Commit

Permalink
Add changesets config and workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
octet-stream committed Oct 24, 2023
1 parent beec141 commit 1960534
Show file tree
Hide file tree
Showing 4 changed files with 882 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"access": "public",
"baseBranch": "main",
"commit": false,
"changelog": [
"@changesets/changelog-github",

{
"repo": "octet-stream/form-data"
}
]
}
58 changes: 58 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Release

on:
push:
branches:
- main

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

jobs:
release:
name: Release
runs-on: ubuntu-22.04

steps:
- name: Checkout
uses: actions/checkout@v4

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

- name: Setup pnpm
id: pnpm-install
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{steps.pnpm-cache.outputs.STORE_PATH}}
key: ${{runner.os}}-pnpm-store-${{hashFiles('**/pnpm-lock.yaml')}}
restore-keys: |
${{runner.os}}-pnpm-store-
- name: Install dependencies
run: pnpm i --frozen-lockfile

- name: Create a Pull Request for a new release
id: changesets
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
uses: changesets/action@v1
with:
title: A new release
commit: Bump version
publish: pnpm run release
version: pnpm exec changeset version
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,12 @@
"test": "cross-env NODE_OPTIONS=\"--no-warnings --loader=ts-node/esm\" ava",
"prepublishOnly": "pinst --disable",
"postpublish": "pinst --enable",
"husky": "husky install"
"husky": "husky install",
"release": "pnpm run build && pnpm exec changeset publish"
},
"devDependencies": {
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.2",
"@octetstream/eslint-config": "7.2.1",
"@types/node": "20.8.7",
"@types/sinon": "10.0.20",
Expand Down
Loading

0 comments on commit 1960534

Please sign in to comment.