Skip to content

Commit

Permalink
Merge pull request #770 from lukso-network/develop
Browse files Browse the repository at this point in the history
chore: sync main to release v0.12.0
  • Loading branch information
CJ42 authored Oct 30, 2023
2 parents 8cb1f99 + 1f92ca5 commit 82c5633
Show file tree
Hide file tree
Showing 117 changed files with 17,347 additions and 19,454 deletions.
49 changes: 0 additions & 49 deletions .github/workflows/build-artifacts.yml

This file was deleted.

51 changes: 0 additions & 51 deletions .github/workflows/create-github-release.yml

This file was deleted.

39 changes: 0 additions & 39 deletions .github/workflows/publish-npm-artifact.yml

This file was deleted.

58 changes: 58 additions & 0 deletions .github/workflows/release.yml
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 }}
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ E.g.:

```solidity
/**
* @custom:events {ValueReceived} event when someone tranfers native tokens to the contract.
* @custom:events {UniversalReceiver} event when someone tranfers native tokens to the contract.
*/
```

Expand All @@ -168,7 +168,7 @@ E.g.:
```solidity
/**
* @custom:events
* - {ValueReceived} event when someone tranfers native tokens to the contract.
* - {UniversalReceiver} event when someone tranfers native tokens to the contract.
* - {Executes} event when the function is executed without any issues.
*/
```
Expand Down
17 changes: 10 additions & 7 deletions DEPLOYMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,30 @@ Available `--tags <options>` are:

- `LSP6KeyManager`: deploy a `UniversalProfile` + `KeyManager`, with the Universal Profile address linked to the Key Manager.

- `LSP6KeyManagerInit`: deploy + initialize (= lock) both a `UniversalProfileInit` + `KeyManagerInit`, as base contracts (**NB:** the Key Manager will be initialized with reference to `address(0)`).
- `LSP6KeyManagerInit`: deploy at deterministic address + initialize (= lock) both a `UniversalProfileInit` + `KeyManagerInit`, as base contracts (**NB:** the Key Manager will be initialized with reference to `address(0)`).

- `LSP1UniversalReceiverDelegateUP`: deploy a Universal Receiver Delegate contract that can be used to register assets and vaults received by a Universal Profile.
- `LSP1UniversalReceiverDelegateUP`: deploy at deterministic address a Universal Receiver Delegate contract that can be used to register assets and vaults received by a Universal Profile.

- `LSP1UniversalReceiverDelegateVault`: deploy a Universal Receiver Delegate contract that can be used to register assets received by a LSP9Vault.
- `LSP1UniversalReceiverDelegateVault`: deploy at deterministic address a Universal Receiver Delegate contract that can be used to register assets received by a LSP9Vault.

- `LSP7Mintable`: deploy a `LSP7Mintable` contract (Token), using the deployer address as the owner and allowing this deployer address to then mint tokens. The `isNFT_` parameter is set to `false`, making the token divisible.

- `LSP8Mintable`: deploy a `LSP7Mintable` contract (NFT), using the deployer address as the owner and allowing this deployer address to then mint tokens.

- `LSP7MintableInit`: deploy + initialize (= lock) a `LSP7MintableInit` contract (Token), that can be used as implementation behind proxy. The base contract is deployed with the `isNonDivisible_` parameter set to `false`, making the implementation token divisible.
- `LSP7MintableInit`: deploy at deterministic address + initialize (= lock) a `LSP7MintableInit` contract (Token), that can be used as implementation behind proxy. The base contract is deployed with the `isNonDivisible_` parameter set to `false`, making the implementation token divisible.

- `LSP8MintableInit`: deploy + initialize (= lock) a `LSP8MintableInit` contract, that can be used as implementation behind proxy.
- `LSP8MintableInit`: deploy at deterministic address + initialize (= lock) a `LSP8MintableInit` contract, that can be used as implementation behind proxy.

- `LSP9Vault`: deploy a `LSP9Vault` contract with the deployer as the owner.

- `LSP9VaultInit`: deploy + initialize (= lock) a `LSP9VaultInit` contract that can be used as implementation behind proxy.
- `LSP9VaultInit`: deploy at deterministic address + initialize (= lock) a `LSP9VaultInit` contract that can be used as implementation behind proxy.

- `standard`: deploy the 4 standard contract above.

- `base`: deploy the 4 base contract above (for proxy use)
- `base`: deploy the 4 base contract above (for proxy use) at deterministic addresses.

> **Note:** all the contracts marked as `base` or `Init` are deployed at deterministic addresses, so that they can be used as implementation behind proxies. If the contract is already deployed on the network, the address where the contract exists already will be returned.
> Moreover, **these contracts use `bytes32(0)` as their `salt` to deploy with CREATE2.**
&nbsp;

Expand Down
79 changes: 40 additions & 39 deletions RELEASE.md
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

&nbsp;
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.
13 changes: 11 additions & 2 deletions constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ export const INTERFACE_IDS = {
LSP1UniversalReceiver: '0x6bb56a14',
LSP1UniversalReceiverDelegate: '0xa245bbda',
LSP6KeyManager: '0x23f34c62',
LSP7DigitalAsset: '0x05519512',
LSP8IdentifiableDigitalAsset: '0x1ae9ba1f',
LSP7DigitalAsset: '0xdaa746b7',
LSP8IdentifiableDigitalAsset: '0x30dc5278',
LSP9Vault: '0x28af17e6',
LSP11BasicSocialRecovery: '0x049a28f1',
LSP14Ownable2Step: '0x94be5999',
Expand Down Expand Up @@ -230,6 +230,9 @@ export const ERC725YDataKeys = {
},
LSP8: {
LSP8TokenIdType: '0x715f248956de7ce65e94d9d836bfead479f7e70d69b718d47bfe7b00e05b4fe4',
LSP8MetadataTokenURI: '0x1339e76a390b7b9ec9010000',
LSP8TokenMetadataBaseURI: '0x1a7628600c3bac7101f53697f48df381ddc36b9015e7d7c9c5633d1252aa2843',
LSP8ReferenceContract: '0x708e7b881795f2e6b6c2752108c177ec89248458de3bf69d0d43480b3e5034e6',
},
LSP9: {
SupportedStandards_LSP9: SupportedStandards.LSP9Vault.key,
Expand Down Expand Up @@ -316,6 +319,9 @@ export const PERMISSIONS = {
* (e.g: token transfer, vault transfer, ownership transfer, etc...)
*/
export const LSP1_TYPE_IDS = {
// keccak256('LSP0ValueReceived')
LSP0ValueReceived: '0x9c4705229491d365fb5434052e12a386d6771d976bea61070a8c694e8affea3d',

// keccak256('LSP0OwnershipTransferStarted')
LSP0OwnershipTransferStarted:
'0xe17117c9d2665d1dbeb479ed8058bbebde3c50ac50e2e65619f60006caac6926',
Expand Down Expand Up @@ -352,6 +358,9 @@ export const LSP1_TYPE_IDS = {
LSP8Tokens_OperatorNotification:
'0x8a1c15a8799f71b547e08e2bcb2e85257e81b0a07eee2ce6712549eef1f00970',

// keccak256('LSP9ValueReceived')
LSP9ValueReceived: '0x468cd1581d7bc001c3b685513d2b929b55437be34700410383d58f3aa1ea0abc',

// keccak256('LSP9OwnershipTransferStarted')
LSP9OwnershipTransferStarted:
'0xaefd43f45fed1bcd8992f23c803b6f4ec45cf6b62b0d404d565f290a471e763f',
Expand Down
Loading

0 comments on commit 82c5633

Please sign in to comment.