Skip to content
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
37 changes: 37 additions & 0 deletions .github/workflows/common/setup-node-and-npm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "Setup Node and npm"
description: "Set up Node.js and ensure an npm supporting 'id-token' is installed"

inputs:
node-version:
description: 'Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0.'
required: false
default: '22.x'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

non-blocking: Is 22 the one we still want or should we go up to 24.x?

cache:
description: 'Used to specify a package manager for caching in the default directory. Supported values: npm, yarn, pnpm.'
required: false
default: 'npm'
cache-dependency-path:
description: 'Used to specify the path to a dependency file: package-lock.json, yarn.lock, etc. Supports wildcards or a list of file names for caching multiple dependencies.'
required: true
registry-url:
description: 'Optional registry to set up for auth. Will set the registry in a project level .npmrc and .yarnrc file, and set up auth to read in from env.NODE_AUTH_TOKEN.'
required: false
default: ''

runs:
using: "composite"
steps:
- name: Set up Node.js
# Use whatever version of setup-node you actually want here
uses: actions/setup-node@v6
with:
node-version: ${{ inputs.node-version }}
cache: ${{ inputs.cache }}
registry-url: ${{ inputs.registry-url }}
cache-dependency-path: ${{ inputs.cache-dependency-path }}

- name: Update npm to at least 11.5.1
shell: bash
run: |
npm install -g npm@11
echo "npm version: $(npm --version)"
13 changes: 4 additions & 9 deletions .github/workflows/e2e-testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ env:
TAG_FROM_UI: ${{github.event.inputs.release-version}}
ETHEREUM_UTILS_FROM_UI: ${{github.event.inputs.ethereum-utils-version}}
RECOVERY_SDK_FROM_UI: ${{github.event.inputs.recovery-sdk-version}}
NODE_VERSION: 22.x

# Set default permissions as restrictive
permissions:
Expand Down Expand Up @@ -59,11 +58,9 @@ jobs:
echo "API_AUGMENT_VERSION=$(echo ${{ env.TAG_FROM_UI }} | sed 's/^v//')" >> $GITHUB_ENV
echo "ETHEREUM_UTILS_VERSION=$(echo ${{ env.ETHEREUM_UTILS_FROM_UI }} | sed 's/^v//')" >> $GITHUB_ENV
echo "RECOVERY_SDK_VERSION=$(echo ${{ env.RECOVERY_SDK_FROM_UI }} | sed 's/^v//')" >> $GITHUB_ENV
- name: Set up NodeJs
uses: actions/setup-node@v6
- name: Setup Node and npm
uses: ./.github/workflows/common/setup-node-and-npm
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
cache-dependency-path: e2e/package.json
- name: Install Built js packages
run: npm install @frequency-chain/api-augment@${{ env.API_AUGMENT_VERSION }} @frequency-chain/ethereum-utils@${{ env.ETHEREUM_UTILS_VERSION }} @frequency-chain/recovery-sdk@${{ env.RECOVERY_SDK_VERSION }} --ignore-scripts
Expand Down Expand Up @@ -107,11 +104,9 @@ jobs:
echo "API_AUGMENT_VERSION=$(echo ${{ env.TAG_FROM_UI }} | sed 's/^v//')" >> $GITHUB_ENV
echo "ETHEREUM_UTILS_VERSION=$(echo ${{ env.ETHEREUM_UTILS_FROM_UI }} | sed 's/^v//')" >> $GITHUB_ENV
echo "RECOVERY_SDK_VERSION=$(echo ${{ env.RECOVERY_SDK_FROM_UI }} | sed 's/^v//')" >> $GITHUB_ENV
- name: Set up NodeJs
uses: actions/setup-node@v6
- name: Setup Node and npm
uses: ./.github/workflows/common/setup-node-and-npm
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
cache-dependency-path: e2e/package.json
- name: Install Built js packages
run: npm install @frequency-chain/api-augment@${{ env.API_AUGMENT_VERSION }} @frequency-chain/ethereum-utils@${{ env.ETHEREUM_UTILS_VERSION }} @frequency-chain/recovery-sdk@${{ env.RECOVERY_SDK_VERSION }} --ignore-scripts
Expand Down
27 changes: 8 additions & 19 deletions .github/workflows/merge-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ permissions:
contents: read
packages: read

env:
NODE_VERSION: 22.x

jobs:
publish-js-api-augment-rc:
name: Merge - Publish JS API Augment Release Candidate
Expand All @@ -26,11 +23,9 @@ jobs:
- name: Output Metadata
# Run the cargo command and ignore any extra lines outside of the json result
run: CARGO_INCREMENTAL=0 RUSTFLAGS="-D warnings" cargo run --features frequency-local -- export-metadata --chain=frequency-paseo-local --tmp ./js/api-augment/metadata.json
- name: Set up NodeJs
uses: actions/setup-node@v6
- name: Setup Node and npm
uses: ./.github/workflows/common/setup-node-and-npm
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
registry-url: "https://registry.npmjs.org"
cache-dependency-path: js/api-augment/package-lock.json
- name: Install
Expand Down Expand Up @@ -62,11 +57,9 @@ jobs:
uses: actions/checkout@v6
with:
ref: ${{env.RELEASE_BRANCH_NAME}}
- name: Set up NodeJs
uses: actions/setup-node@v6
- name: Setup Node and npm
uses: ./.github/workflows/common/setup-node-and-npm
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
registry-url: "https://registry.npmjs.org"
cache-dependency-path: js/ethereum-utils/package-lock.json
- name: Install
Expand Down Expand Up @@ -98,11 +91,9 @@ jobs:
uses: actions/checkout@v6
with:
ref: ${{env.RELEASE_BRANCH_NAME}}
- name: Set up NodeJs
uses: actions/setup-node@v6
- name: Setup Node and npm
uses: ./.github/workflows/common/setup-node-and-npm
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
registry-url: "https://registry.npmjs.org"
cache-dependency-path: js/schemas/package-lock.json
- name: Install
Expand Down Expand Up @@ -134,11 +125,9 @@ jobs:
uses: actions/checkout@v6
with:
ref: ${{env.RELEASE_BRANCH_NAME}}
- name: Set up NodeJs
uses: actions/setup-node@v6
- name: Setup Node and npm
uses: ./.github/workflows/common/setup-node-and-npm
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
registry-url: "https://registry.npmjs.org"
cache-dependency-path: js/recovery-sdk/package-lock.json
- name: Install
Expand Down
50 changes: 17 additions & 33 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ on:
required: true

permissions:
id-token: write # Required for OIDC
contents: write
statuses: write

Expand All @@ -27,7 +28,6 @@ env:
RELEASE_BRANCH_NAME: release-${{github.event.inputs.release-version || github.ref_name}}
LATEST_FULL_RELEASE_TAG: _LATEST-FULL-RELEASE
TEST_RUN: ${{startsWith(github.event.inputs.release-version || github.ref_name, 'v0.0.1')}}
NODE_VERSION: 22.x

jobs:
validate-release-version:
Expand Down Expand Up @@ -442,11 +442,9 @@ jobs:
uses: actions/checkout@v6
with:
ref: ${{env.RELEASE_BRANCH_NAME}}
- name: Set up NodeJs
uses: actions/setup-node@v6
- name: Setup Node and npm
uses: ./.github/workflows/common/setup-node-and-npm
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
registry-url: "https://registry.npmjs.org"
cache-dependency-path: js/api-augment/package-lock.json
- name: Install
Expand Down Expand Up @@ -489,11 +487,9 @@ jobs:
uses: actions/checkout@v6
with:
ref: ${{env.RELEASE_BRANCH_NAME}}
- name: Set up NodeJs
uses: actions/setup-node@v6
- name: Setup Node and npm
uses: ./.github/workflows/common/setup-node-and-npm
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
registry-url: "https://registry.npmjs.org"
cache-dependency-path: js/ethereum-utils/package-lock.json
- name: Install
Expand All @@ -518,11 +514,9 @@ jobs:
uses: actions/checkout@v6
with:
ref: ${{env.RELEASE_BRANCH_NAME}}
- name: Set up NodeJs
uses: actions/setup-node@v6
- name: Setup Node and npm
uses: ./.github/workflows/common/setup-node-and-npm
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
registry-url: "https://registry.npmjs.org"
cache-dependency-path: js/schemas/package-lock.json
- name: Install
Expand All @@ -547,11 +541,9 @@ jobs:
uses: actions/checkout@v6
with:
ref: ${{env.RELEASE_BRANCH_NAME}}
- name: Set up NodeJs
uses: actions/setup-node@v6
- name: Setup Node and npm
uses: ./.github/workflows/common/setup-node-and-npm
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
registry-url: "https://registry.npmjs.org"
cache-dependency-path: js/recovery-sdk/package-lock.json
- name: Install
Expand Down Expand Up @@ -1235,11 +1227,9 @@ jobs:
uses: ./.github/workflows/common/is-full-release
with:
version-tag: ${{env.NEW_RELEASE_TAG}}
- name: Set up NodeJs
uses: actions/setup-node@v6
- name: Setup Node and npm
uses: ./.github/workflows/common/setup-node-and-npm
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
registry-url: "https://registry.npmjs.org"
cache-dependency-path: js/api-augment/package-lock.json
- name: Download Dist Dir
Expand Down Expand Up @@ -1281,11 +1271,9 @@ jobs:
uses: ./.github/workflows/common/is-full-release
with:
version-tag: ${{env.NEW_RELEASE_TAG}}
- name: Set up NodeJs
uses: actions/setup-node@v6
- name: Setup Node and npm
uses: ./.github/workflows/common/setup-node-and-npm
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
registry-url: "https://registry.npmjs.org"
cache-dependency-path: js/ethereum-utils/package-lock.json
- name: Download Dist Dir
Expand Down Expand Up @@ -1327,11 +1315,9 @@ jobs:
uses: ./.github/workflows/common/is-full-release
with:
version-tag: ${{env.NEW_RELEASE_TAG}}
- name: Set up NodeJs
uses: actions/setup-node@v6
- name: Setup Node and npm
uses: ./.github/workflows/common/setup-node-and-npm
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
registry-url: "https://registry.npmjs.org"
cache-dependency-path: js/schemas/package-lock.json
- name: Download Dist Dir
Expand Down Expand Up @@ -1373,11 +1359,9 @@ jobs:
uses: ./.github/workflows/common/is-full-release
with:
version-tag: ${{env.NEW_RELEASE_TAG}}
- name: Set up NodeJs
uses: actions/setup-node@v6
- name: Setup Node and npm
uses: ./.github/workflows/common/setup-node-and-npm
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm seeing the use NODE_AUTH_TOKEN and want to make sure that is different from what Scott mentioned for

And remove any reference to npm config that uses NPM_AUTH_TOKEN.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's only referenced in the description for the registry-url input of the new custom action. That description was copied from actions/setup-node@v6 because it's just a pass-through. I don't believe we're setting NPM_AUTH_TOKEN anywhere in our CI in this repo anymore. Unless it's configured at the organization level, but that's outside the scope of this PR.

I think registry-url is still relevant to use...

with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
registry-url: "https://registry.npmjs.org"
cache-dependency-path: js/recovery-sdk/package-lock.json
- name: Download Dist Dir
Expand Down
39 changes: 14 additions & 25 deletions .github/workflows/verify-pr-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ env:
PR_LABEL_METADATA_CHANGED: metadata-changed
PR_LABEL_METADATA_VERSION_NOT_INCREMENTED: metadata-version-not-incremented
NIGHTLY_TOOLCHAIN: nightly-2025-04-03
NODE_VERSION: 22.x

jobs:
changes:
Expand Down Expand Up @@ -442,11 +441,9 @@ jobs:
- name: Set Env Vars
run: |
echo "BIN_FILENAME=frequency.local.amd64.frequency-local.pr" >> $GITHUB_ENV
- name: Set up NodeJs
uses: actions/setup-node@v6
- name: Setup Node and npm
uses: ./.github/workflows/common/setup-node-and-npm
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
cache-dependency-path: js/api-augment/package-lock.json
- name: Install Latest Versions
run: npm install --ignore-scripts # DO NOT use `npm ci` as we want the latest polkadot/api possible
Expand Down Expand Up @@ -478,7 +475,7 @@ jobs:
run: npm test
working-directory: js/api-augment
- name: Build & Publish Dry Run
run: npm publish --dry-run
run: npm publish --dry-run --tag ci-validation
working-directory: js/api-augment/dist
- name: Generate npm tarball
run: npm pack
Expand All @@ -498,11 +495,9 @@ jobs:
steps:
- name: Check Out Repo
uses: actions/checkout@v6
- name: Set up NodeJs
uses: actions/setup-node@v6
- name: Setup Node and npm
uses: ./.github/workflows/common/setup-node-and-npm
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
cache-dependency-path: js/ethereum-utils/package-lock.json
- name: Install Latest Versions
run: npm install --ignore-scripts
Expand All @@ -517,7 +512,7 @@ jobs:
run: npm run build
working-directory: js/ethereum-utils
- name: Build & Publish Dry Run
run: npm publish --dry-run
run: npm publish --dry-run --tag ci-validation
working-directory: js/ethereum-utils/dist
- name: Generate npm tarball
run: npm pack
Expand All @@ -536,11 +531,9 @@ jobs:
steps:
- name: Check Out Repo
uses: actions/checkout@v6
- name: Set up NodeJs
uses: actions/setup-node@v6
- name: Setup Node and npm
uses: ./.github/workflows/common/setup-node-and-npm
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
cache-dependency-path: js/schemas/package-lock.json
- name: Install Latest Versions
run: npm install --ignore-scripts
Expand All @@ -555,7 +548,7 @@ jobs:
run: npm run build
working-directory: js/schemas
- name: Publish Dry Run
run: npm publish --dry-run
run: npm publish --dry-run --tag ci-validation
working-directory: js/schemas/dist
- name: Generate npm tarball
run: npm pack
Expand All @@ -574,11 +567,9 @@ jobs:
steps:
- name: Check Out Repo
uses: actions/checkout@v6
- name: Set up NodeJs
uses: actions/setup-node@v6
- name: Setup Node and npm
uses: ./.github/workflows/common/setup-node-and-npm
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
cache-dependency-path: js/recovery-sdk/package-lock.json
- name: Install Latest Versions
run: npm install --ignore-scripts
Expand All @@ -593,7 +584,7 @@ jobs:
run: npm run build
working-directory: js/recovery-sdk
- name: Publish Dry Run
run: npm publish --dry-run
run: npm publish --dry-run --tag ci-validation
working-directory: js/recovery-sdk/dist
- name: Generate npm tarball
run: npm pack
Expand Down Expand Up @@ -895,11 +886,9 @@ jobs:
--rpc-methods=Unsafe \
--tmp \
&
- name: Set up NodeJs
uses: actions/setup-node@v6
- name: Setup Node and npm
uses: ./.github/workflows/common/setup-node-and-npm
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
cache-dependency-path: e2e/package.json
- name: Install Built api-augment and ethereum-utils and recovery-sdk
run: npm install ../js/api-augment/dist/frequency-chain-api-augment-0.0.0.tgz ../js/ethereum-utils/dist/frequency-chain-ethereum-utils-0.0.0.tgz ../js/recovery-sdk/dist/frequency-chain-recovery-sdk-0.0.0.tgz --ignore-scripts
Expand Down