fix: Add new compatibility layer (require or import compatibility-node for node/bun or so) #94
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" | |
pull_request: | |
branches: | |
- "main" | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
release-please: | |
runs-on: ubuntu-latest | |
env: | |
TEST_PINATAAPIKEY: ${{ secrets.TEST_PINATAAPIKEY }} | |
TEST_PINATASECRETAPIKEY: ${{ secrets.TEST_PINATASECRETAPIKEY }} | |
TEST_PINATAJWTKEY: ${{ secrets.TEST_PINATAJWTKEY }} | |
TEST_INFURA_API_KEY_NAME: ${{ secrets.TEST_INFURA_API_KEY_NAME }} | |
TEST_INFURA_API_KEY: ${{ secrets.TEST_INFURA_API_KEY }} | |
TEST_INFURA_GATEWAY: ${{ secrets.TEST_INFURA_GATEWAY }} | |
TEST_SHARED_KEY: ${{ secrets.TEST_SHARED_KEY }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: google-github-actions/release-please-action@v3 | |
id: release | |
with: | |
release-type: node | |
bump-minor-pre-major: true | |
default-branch: main | |
command: manifest | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: "8.8.0" | |
- name: Use Node.js '18.19.0' | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "18.19.0" | |
registry-url: "https://registry.npmjs.org" | |
scope: "@lukso" | |
cache: "pnpm" | |
- name: Setup Foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
with: | |
version: nightly | |
- name: Install pnpm/forge | |
run: | | |
git submodule update --init --recursive | |
pnpm install | |
cd packages/data-provider-fetcher | |
forge install | |
- name: Install Dependencies | |
run: pnpm install | |
# `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 | |
run: pnpm run build | |
- name: Tests | |
run: pnpm run test | |
- uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: latest | |
- name: 🧪 Run Tests in shell | |
run: | | |
bun install | |
node examples/upload-pinata-proxy.mjs | |
bun examples/upload-pinata-proxy.mjs | |
node examples/upload-pinata.mjs | |
bun examples/upload-pinata.mjs | |
node examples/upload-infura.mjs | |
bun examples/upload-infura.mjs | |
- name: Colled documentation | |
run: | | |
pnpm run documentation | |
- name: Deploy | |
# if: ${{ steps.release.outputs.release_created }} | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./docs | |
enable_jekyll: true | |
- run: | | |
(cat <<END > outputs.json | |
${{toJSON(steps.release.outputs)}} | |
END | |
) | |
node ./scripts/publish.mjs outputs.json | |
if: ${{ steps.release.outputs.releases_created }} | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |