Skip to content

Commit

Permalink
ci(release): add support to release via release-please (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
H4ad authored Jan 13, 2025
1 parent 11be8e5 commit 5263cc6
Show file tree
Hide file tree
Showing 5 changed files with 134 additions and 2 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/commit-message-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Commit Message Validation

on:
pull_request:

jobs:
validate:
name: Validate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: webiny/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Release

on:
push:
branches:
- main

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

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Release Please
uses: google-github-actions/release-please-action@v4
id: release

- name: Use Node 22.x
uses: actions/setup-node@v4
if: ${{ steps.release.outputs.release_created }}
with:
node-version: 22
registry-url: 'https://registry.npmjs.org'

- name: Install Deps
run: npm install
if: ${{ steps.release.outputs.release_created }}

- name: NPM Publish
run: npm publish --provenance --access public
if: ${{ steps.release.outputs.release_created }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:

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

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

Expand Down
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.5.0"
}
73 changes: 73 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"packages": {
".": {
"release-type": "node",
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"draft": false,
"prerelease": false,
"draft-pull-request": true,
"include-component-in-tag": false,
"include-v-in-tag": true,
"separate-pull-requests": false,
"skip-github-release": false,
"versioning": "default",
"pull-request-header": ":robot: I have created a release *beep* *boop*",
"pull-request-title-pattern": "chore${scope}: release${component} ${version}",
"changelog-path": "CHANGELOG.md",
"changelog-host": "https://github.com",
"changelog-type": "default",
"changelog-sections": [
{
"type": "feat",
"section": "Features"
},
{
"type": "feature",
"section": "Features"
},
{
"type": "fix",
"section": "Bug Fixes"
},
{
"type": "perf",
"section": "Performance Improvements"
},
{
"type": "revert",
"section": "Reverts"
},
{
"type": "docs",
"section": "Documentation"
},
{
"type": "style",
"section": "Styles"
},
{
"type": "chore",
"section": "Miscellaneous Chores"
},
{
"type": "refactor",
"section": "Code Refactoring"
},
{
"type": "test",
"section": "Tests"
},
{
"type": "build",
"section": "Build System"
},
{
"type": "ci",
"section": "Continuous Integration"
}
]
}
},
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
}

0 comments on commit 5263cc6

Please sign in to comment.