Skip to content

Commit

Permalink
chore: add release automation and dependabot
Browse files Browse the repository at this point in the history
  • Loading branch information
gmickel committed Jul 20, 2024
1 parent ab63faf commit be164a6
Show file tree
Hide file tree
Showing 5 changed files with 1,780 additions and 18 deletions.
32 changes: 32 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version: 2
updates:
# Root package.json
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
allow:
- dependency-type: "all"
open-pull-requests-limit: 10
versioning-strategy: "auto"
commit-message:
prefix: "chore"
include: "scope"
labels:
- "dependencies"
ignore:
- dependency-name: "*"
update-types:
["version-update:semver-major", "version-update:semver-minor"]

# GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "chore"
include: "scope"
labels:
- "dependencies"
- "github-actions"
31 changes: 17 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
name: Release

permissions:
contents: write

on:
push:
tags:
- 'v*'

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- name: Install pnpm
uses: pnpm/action-setup@v3

- name: Set node
uses: actions/setup-node@v4
uses: pnpm/action-setup@v2
with:
node-version: lts/*

- run: npx changelogithub
version: 8
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm build
- name: Release
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm semantic-release
23 changes: 23 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
[
"@semantic-release/npm",
{
"pkgRoot": ".",
"npmPublish": true
}
],
[
"@semantic-release/git",
{
"assets": ["package.json", "CHANGELOG.md"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
"@semantic-release/github"
]
}
14 changes: 11 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
"lint": "biome check .",
"lint:fix": "biome check . --write",
"prepublishOnly": "nr build",
"release": "bumpp && npm publish",
"prerelease": "pnpm run lint && pnpm run test && pnpm run build",
"release": "semantic-release",
"dev": "esno src/cli/index.ts",
"start": "node dist/cli/index.js",
"test": "vitest",
Expand All @@ -68,21 +69,28 @@
},
"devDependencies": {
"@biomejs/biome": "1.8.3",
"@semantic-release/changelog": "6.0.3",
"@semantic-release/git": "10.0.1",
"@types/fs-extra": "11.0.4",
"@types/inquirer": "^9.0.7",
"@types/inquirer": "9.0.7",
"@types/node": "20.14.11",
"@types/strip-comments": "2.0.4",
"@vitest/coverage-v8": "2.0.3",
"@vitest/ui": "2.0.3",
"bumpp": "9.4.1",
"esno": "4.7.0",
"lefthook": "1.7.4",
"semantic-release": "24.0.0",
"tsup": "8.2.0",
"typescript": "5.5.3",
"vite": "5.3.4",
"vitest": "2.0.3"
},
"packageManager": "[email protected]",
"workspaces": ["apps/*", "packages/*"],
"trustedDependencies": ["@biomejs/biome", "lefthook"]
"trustedDependencies": ["@biomejs/biome", "lefthook"],
"publishConfig": {
"registry": "https://registry.npmjs.org/",
"access": "public"
}
}
Loading

0 comments on commit be164a6

Please sign in to comment.