-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #770 from lukso-network/develop
chore: sync main to release v0.12.0
- Loading branch information
Showing
117 changed files
with
17,347 additions
and
19,454 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Github + NPM Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
release-please: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: google-github-actions/release-please-action@v3 | ||
id: release | ||
with: | ||
release-type: node | ||
package-name: "@lukso/lsp-smart-contracts" | ||
bump-minor-pre-major: true | ||
default-branch: main | ||
changelog-types: '[{"type": "feat!","section":"BREAKING CHANGES","hidden": false},{"type": "refactor!","section":"BREAKING CHANGES","hidden": false},{"type": "build!","section":"BREAKING CHANGES","hidden": false},{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":false}]' | ||
|
||
# The logic below handles the npm publication. | ||
# The `if` statements ensure that a publication only occurs when | ||
# a new release is created: | ||
|
||
- uses: actions/checkout@v3 | ||
if: ${{ steps.release.outputs.release_created }} | ||
|
||
- name: Use Node.js '16.15.0' | ||
uses: actions/setup-node@v2 | ||
if: ${{ steps.release.outputs.release_created }} | ||
with: | ||
node-version: "16.15.0" | ||
registry-url: "https://registry.npmjs.org" | ||
scope: "@lukso" | ||
cache: "npm" | ||
|
||
- name: Install Dependencies | ||
if: ${{ steps.release.outputs.release_created }} | ||
run: npm ci | ||
|
||
# `npm run build:js` will also generate the auto-generated constants for methods, errors and events, | ||
# including extracting their devdocs and userdocs | ||
- name: Prepare artifacts to publish | ||
if: ${{ steps.release.outputs.release_created }} | ||
run: | | ||
npm run build | ||
npm run build:js | ||
npm run package | ||
- name: Publish on NPM | ||
if: ${{ steps.release.outputs.release_created }} | ||
run: npm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,62 @@ | ||
# **Release Process** | ||
|
||
Releases are published when a commit including an increase in the `package.json` version number is merged to the `main` branch. | ||
Releases are created on the Github repository and published to [npm]() using the [Release Please](https://github.com/googleapis/release-please) via the [`release-please`](https://github.com/google-github-actions/release-please-action#automating-publication-to-npm) Github action. | ||
|
||
This function increases the version automatically using [standard-version](https://github.com/conventional-changelog/standard-version): | ||
This package automates CHANGELOG generation, version bumps and npm releases by parsing the git history, looking for [Conventional Commit messages](https://www.conventionalcommits.org/). | ||
|
||
```bash | ||
$ npm run release | ||
``` | ||
|
||
If the current branch contains new commits since the last git tag that contains [conventional commit](https://www.conventionalcommits.org/en/v1.0.0/) prefixes like `feat`, `fix` or `docs`, it will increase the version as follows: | ||
|
||
- `feat` will increase the `minor` version | ||
- `fix` and `docs` will increase the `patch` version | ||
When changes and feature PRs are merged from develop to main, release-please will open and maintain a release PR with the updated CHANGELOG and new version number. When this PR is merged, a release will be created and the package published to NPM. | ||
|
||
Standard-version then: | ||
1. Merge develop into main. | ||
2. Release Please will create the release PR going to main. | ||
3. Merge the generated release PR. | ||
4. Package will be published to NPM. | ||
|
||
1. updates the `package.json` version | ||
2. adds to the `CHANGELOG.md` all commit messages grouped by `Feature`, `Bug Fixes`, `Documentation` or `Other` | ||
3. commits all changes under: `chore(release): <version>` | ||
## Conventional Commit prefixes? | ||
|
||
Then push the changes to `develop`: | ||
Commits should follow the [Conventional Commit messages standard](https://www.conventionalcommits.org/). | ||
|
||
```bash | ||
$ git push origin develop | ||
``` | ||
The following commit prefixes will result in changes in the CHANGELOG: | ||
|
||
A NPM and GitHub release is created when a version change in `package.json` is merged into `main`. | ||
- `fix:` which represents bug fixes, and correlates to a [SemVer](https://semver.org/) | ||
patch. | ||
- `feat:` which represents a new feature, and correlates to a minor version increase. | ||
(indicated by the `!`) and will result in a SemVer major version increase. | ||
- `feat!:`, or `fix!:`, `refactor!:`, etc., which represent a breaking change | ||
- `build:` Changes that affect the build system or external dependencies. | ||
- `ci:` Changes to our CI configuration files and scripts. | ||
- `docs:` Documentation only changes. | ||
- `perf:` A code change that improves performance. | ||
- `refactor:` A code change that neither fixes a bug nor adds a feature. | ||
- `style:` Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc). | ||
- `test:` Adding missing tests or correcting existing tests. | ||
- `chore:` Other | ||
|
||
A git tag will then be created, a GitHub Release created with the description of the PR to `main` as the release notes with the appended `CHANGELOG.md` content. | ||
At last a release will be published in NPM automatically. | ||
## Release with a custom version number | ||
|
||
| ||
When a commit to the main branch has `Release-As: x.x.x` (case insensitive) in the **commit body**, Release Please will open a new pull request for the specified version. | ||
|
||
## Specific Version Increases | ||
`git commit --allow-empty -m "chore: release 2.0.0" -m "Release-As: 2.0.0"` results in the following commit message: | ||
|
||
To ignore the automatic version increase in favour of a custom version use the `--release-as` flag with the argument `major`, `minor` or `patch` or a specific version number: | ||
```txt | ||
chore: release 2.0.0 | ||
```bash | ||
npm run release -- --release-as minor | ||
# Or | ||
npm run release -- --release-as 1.1.0 | ||
Release-As: 2.0.0 | ||
``` | ||
|
||
## Prerelease versions | ||
## How can I fix release notes? | ||
|
||
To create a pre-release run: | ||
If you have merged a pull request and would like to amend the commit message | ||
used to generate the release notes for that commit, you can edit the body of | ||
the merged pull requests and add a section like: | ||
|
||
```bash | ||
npm run release -- --prerelease | ||
``` | ||
BEGIN_COMMIT_OVERRIDE | ||
feat: add ability to override merged commit message | ||
If the lastest version is 1.0.0, the pre-release command will change the version to: `1.0.1-0` | ||
|
||
To name the pre-release, set the name by adding `--prerelease <name>` | ||
|
||
```bash | ||
npm run release -- --prerelease alpha | ||
fix: another message | ||
chore: a third message | ||
END_COMMIT_OVERRIDE | ||
``` | ||
|
||
If the latest version is 1.0.0 this will change the version to: `1.0.1-alpha.0` | ||
The next time Release Please runs, it will use that override section as the | ||
commit message instead of the merged commit message. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.