Merge pull request #1003 from lukso-network/fix/lsp7-version #68
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
name: Github + NPM Release | |
on: | |
push: | |
branches: | |
- "main" | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
release-please: | |
runs-on: ubuntu-latest | |
environment: publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_KEY }} | |
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}]' | |
command: manifest | |
# 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@v4 | |
if: ${{ steps.release.outputs.releases_created }} | |
- name: Use Node.js v20 | |
uses: actions/setup-node@v4 | |
if: ${{ steps.release.outputs.releases_created }} | |
with: | |
node-version: "20.x" | |
registry-url: "https://registry.npmjs.org" | |
scope: "@lukso" | |
cache: "npm" | |
- name: Install Dependencies | |
if: ${{ steps.release.outputs.releases_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 | |
# `npm run build:types` will generate: | |
# - the artifacts with abis for release (artifacts/*.json) | |
# - the wagmi hooks (types/index.ts) | |
# - the typed abis (types/index.ts) | |
# | |
# # The turbo configs in `turbo.json` is setup to run `npm run package` command first before `npm run build:types`. | |
- name: Prepare artifacts to publish | |
if: ${{ steps.release.outputs.releases_created }} | |
run: | | |
npm run build:js | |
npm run build:types | |
- name: Publish on NPM | |
if: ${{ steps.release.outputs.releases_created }} | |
run: | | |
(cat <<END > outputs.json | |
${{toJSON(steps.release.outputs)}} | |
END | |
) | |
node ./publish.mjs outputs.json |