diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..9e55946 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,33 @@ +name: Lint and Build + +on: + release: + types: [created] + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20] + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + + - name: Install dependencies + run: npm install + + - name: Lint + run: npm run lint + + - name: Build package + run: npm run build + diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6755d82..6fe8ecc 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,7 +1,6 @@ -# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created -# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages +# Publish @meshsdk/hydra to npm when a PR to main is merged and package version was updated. -name: Publish Mesh SDK Hydra +name: Publish @meshsdk/hydra on: pull_request: @@ -47,7 +46,7 @@ jobs: - name: Checkout main branch at commit after merge uses: actions/checkout@v4 with: - ref: "main" + ref: main - name: Get package version from main branch after merge id: post-merge-version @@ -59,9 +58,9 @@ jobs: id: compare-versions run: | if [[ "${{ steps.pre-merge-version.outputs.pre_merge_version }}" != "${{ steps.post-merge-version.outputs.post_merge_version }}" ]]; then - echo "version-updated=true" >> "$GITHUB_OUTPUT" + echo "version-updated=true" >> "$GITHUB_OUTPUT" else - echo "version-updated=false" >> "$GITHUB_OUTPUT" + echo "version-updated=false" >> "$GITHUB_OUTPUT" fi publish-meshsdk-hydra: @@ -77,4 +76,4 @@ jobs: - run: npm install && npm run build - run: npm publish --access public env: - NODE_AUTH_TOKEN: ${{secrets.npm_token}} \ No newline at end of file + NODE_AUTH_TOKEN: ${{ secrets.npm_token }} diff --git a/package.json b/package.json index e372c2f..ecf6b48 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@meshsdk/hydra", - "version": "1.9.0-beta.96", + "version": "1.9.0-beta.99", "description": "Mesh Hydra package", "main": "./dist/index.cjs", "browser": "./dist/index.js", diff --git a/src/hydra-provider.ts b/src/hydra-provider.ts index 60f9f27..7a844d6 100644 --- a/src/hydra-provider.ts +++ b/src/hydra-provider.ts @@ -119,12 +119,10 @@ export class HydraProvider implements IFetcher, ISubmitter { * - Accurate state tracking */ async isConnected(timeoutMs = 30_000): Promise { - // Fast path if (this._connectionState === "CONNECTED") { return true; } - // Reuse in-flight connection if (this._connectingPromise) { return this._connectingPromise; }