Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add release workflow #13

Merged
merged 3 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
on:
push:
branches:
- main
name: release-please

jobs:
release-please:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v4
id: release
with:
token: ${{ secrets.RELEASE_PLEASE_GITHUB_PAT }}
release-type: node
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install && npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
if: ${{ steps.release.outputs.release_created }}
20 changes: 20 additions & 0 deletions .github/workflows/semantic-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Semantic Pull Request"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

permissions:
pull-requests: read

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_PLEASE_GITHUB_PAT }}
29 changes: 15 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,25 @@ Thanks for contributing to this app!

This project uses [standard](https://npm.im/standard) for linting. Please make sure your code passes the linter before submitting a pull request.

## Release
## Pull Requests

Releases are published manually for now using [np](https://npm.im/np):
This project follows the Conventional Commits spec to simplify and automate the process of releasing new versions.

Cut a patch release (with a bug fix):
When opening a pull request, give your PR title a semantic prefix like `fix:`, `feat:`, or `chore:` to indicate what kind of change you're making.

```console
npx np patch
```
Here are some valid example pull request titles:

Cut a minor release (with a new feature):
- fix: Correct typo
- feat: Add support for Node.js 18
- refactor!: Drop support for Node.js 12 (breaking change)
- feat(ui): Add `Button` component

```console
npx np minor
```
See [Conventional Commits](https://www.conventionalcommits.org/) for more examples.

Cut a major release (with breaking changes):
## Release process

```console
npx np major
```
This project uses [Release Please](https://github.com/googleapis/release-please) and GitHub Actions to automate releases.

Release Please automates CHANGELOG generation, the creation of GitHub releases, and version bumps.

Rather than continuously releasing what's landed on the main branch, release-please maintains Release PRs, which are kept up to date as additional work is merged. When we're ready to tag a release, we merge the release PR and the release is published to GitHub and npm automatically.