Skip to content

Commit

Permalink
add changesets
Browse files Browse the repository at this point in the history
  • Loading branch information
beeequeue committed Sep 1, 2024
1 parent 0c417bd commit c26705b
Show file tree
Hide file tree
Showing 6 changed files with 743 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https:/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https:/changesets/changesets/blob/master/docs/common-questions.md)
14 changes: 14 additions & 0 deletions .changeset/changelog-formatter.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const { default: baseFunctions } = require("@changesets/changelog-github")

/*
* This is just a small wrapper around the base changelog-github formatter that
* removes "Thanks @Beeequeue!" as it would be on every changelog entry
*/
exports.default = {
getDependencyReleaseLine: baseFunctions.getDependencyReleaseLine,
getReleaseLine: async (...options) => {
const line = await baseFunctions.getReleaseLine(...options)

return line.replace(/Thanks \[@BeeeQueue.*?!/g, "")
},
}
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"access": "public",
"baseBranch": "main",
"changelog": [
"./changelog-formatter.cjs",
{
"repo": "BeeeQueue/binary-util"
}
]
}
57 changes: 57 additions & 0 deletions .github/workflows/changesets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: changesets

on:
push:
branches:
- main
paths:
- .changeset/**/*
workflow_dispatch:

permissions:
contents: write
pull-requests: write
id-token: write

jobs:
changesets:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version: 22

- run: corepack enable

- name: find pnpm cache path
id: cache
run: echo "path=$(pnpm store path)" >> $GITHUB_OUTPUT

- uses: actions/cache@v4
with:
path: ${{ steps.cache.outputs.path }}
key: v1-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
v1-pnpm-
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build
run: pnpm run build

- name: Update release PR / Publish packages to `npm`
id: changesets
uses: changesets/action@v1
with:
title: Release
commit: Release new version
env:
NPM_CONFIG_PROVENANCE: true
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
},
"devDependencies": {
"@antfu/eslint-config": "3.0.0",
"@changesets/changelog-github": "0.5.0",
"@changesets/cli": "2.27.7",
"@tsconfig/node22": "22.0.0",
"@tsconfig/strictest": "2.0.5",
"@types/node": "22.5.1",
Expand Down
Loading

0 comments on commit c26705b

Please sign in to comment.