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

Setup release-please to automate part of our release process #96

Merged
merged 4 commits into from
Sep 24, 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
18 changes: 0 additions & 18 deletions .github/workflows/publish.yml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release

on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
release:
if: github.repository == 'tremendous-rewards/tremendous-node'
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node

- uses: actions/checkout@v4
if: ${{ steps.release.outputs.release_created }}

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

- run: npm ci
if: ${{ steps.release.outputs.release_created }}

- run: npm run build
if: ${{ steps.release.outputs.release_created }}

- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
if: ${{ steps.release.outputs.release_created }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/node_modules/
/npm-debug.log
./dist
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Changelog
20 changes: 10 additions & 10 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ bin/generate && npm run build
```

After that, please review the changes to double check that the changes to the API spec were
generated correctly. Please open a Pull Request with the file changes and wait for the test pipeline
before merging it to master.
generated correctly.

## Step 2 - Update the version on `package.json`
Please open a Pull Request with the file changes and wait for the test pipeline before merging it
to main. Make sure to use [Conventional Commit messages]([2]) to help automating the process.

The Pull Request with the changes to the generated files should update the version on `package.json`
following [Semantic Versioning][2] practices - most changes here should be backwards compatible and
deserve a MINOR version update
## Step 2 - Merge the Release Please Pull Request

## Step 3 - Publish a new release on GitHub
[Release Please](https://github.com/googleapis/release-please) will maintain a "Release PR" that
consolidates updates to `CHANGELOG.md` (based on the git history) and updating the `package.json`
file.

The [publish.yml](.github/workflows/publish.yml) workflow is responsible for publishing the package to
NPM when a new release is published on GitHub.
When ready to publish a release, merge the Release PR and the [release.yml]
(.github/workflows/release.yml) workflow will publish a new package to NPM and create a release on GitHub.

[1]: https://openapi-generator.tech
[2]: https://semver.org
[2]: https://www.conventionalcommits.org/en/v1.0.0/
Loading