Skip to content

Commit

Permalink
ci: setup release-please
Browse files Browse the repository at this point in the history
  • Loading branch information
9romise committed Dec 15, 2024
1 parent fa043da commit f873079
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 51 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: release-please

on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: googleapis/release-please-action@v4
id: release

publish-npm:
runs-on: ubuntu-latest
needs: release-please
if: ${{ needs.release-please.outputs.release_created }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
registry-url: https://registry.npmjs.org/
cache: pnpm

- run: npm i -g @antfu/ni
- run: nci
- run: nr build

- name: Publish package
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Generate changelog
run: nlx changelogithub
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
48 changes: 0 additions & 48 deletions .github/workflows/release.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .release-please-mainfest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.6.0"
}
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
"prepare": "npx simple-git-hooks && pnpm build",
"lint": "eslint .",
"test": "vitest",
"typecheck": "tsc --noEmit",
"release": "bumpp"
"typecheck": "tsc --noEmit"
},
"peerDependencies": {
"eslint": "*",
Expand All @@ -62,7 +61,6 @@
"devDependencies": {
"@types/node": "^22.10.1",
"@vida0905/eslint-config": "^1.1.1",
"bumpp": "^9.8.1",
"eslint": "^9.16.0",
"eslint-vitest-rule-tester": "^0.6.1",
"lint-staged": "^15.2.10",
Expand Down
57 changes: 57 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"release-type": "node",
"pull-request-title-pattern": "chore: release v${version}",
"include-component-in-tag": false,
"changelog-sections": [
{
"type": "feat",
"section": "Features",
"hidden": false
},
{
"type": "fix",
"section": "Bug Fixes",
"hidden": false
},
{
"type": "docs",
"section": "Documentation",
"hidden": true
},
{
"type": "build",
"section": "Build Related",
"hidden": false
},
{
"type": "chore",
"section": "Chores",
"hidden": true
},
{
"type": "perf",
"section": "Performance",
"hidden": false
},
{
"type": "ci",
"section": "Chores",
"hidden": true
},
{
"type": "refactor",
"section": "Chores",
"hidden": false
},
{
"type": "test",
"section": "Chores",
"hidden": false
}
],
"packages": {
"*": {
}
}
}

0 comments on commit f873079

Please sign in to comment.