kokio-sdk 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/{src/abis/BeaconProxy.json → dist/esm/abis/BeaconProxy.js} +3 -2
  2. package/dist/esm/abis/DeviceWallet.js +913 -0
  3. package/{src/abis/DeviceWalletFactory.json → dist/esm/abis/DeviceWalletFactory.js} +3 -2
  4. package/{src/abis/ESIMWallet.json → dist/esm/abis/ESIMWallet.js} +3 -2
  5. package/{src/abis/ESIMWalletFactory.json → dist/esm/abis/ESIMWalletFactory.js} +3 -2
  6. package/{src/abis/LazyWalletRegistry.json → dist/esm/abis/LazyWalletRegistry.js} +3 -2
  7. package/{src/abis/P256Verifier.json → dist/esm/abis/P256Verifier.js} +3 -2
  8. package/{src/abis/Registry.json → dist/esm/abis/Registry.js} +3 -2
  9. package/{src/abis/RegistryHelper.json → dist/esm/abis/RegistryHelper.js} +3 -2
  10. package/dist/esm/abis/index.js +10 -0
  11. package/dist/esm/config.js +40 -0
  12. package/dist/esm/interface/P256VerifierClass.js +10 -0
  13. package/dist/esm/interface/constantsClass.js +15 -0
  14. package/{src/interface/deviceWalletClass.ts → dist/esm/interface/deviceWalletClass.js} +12 -36
  15. package/dist/esm/interface/deviceWalletFactoryClass.js +18 -0
  16. package/dist/esm/interface/eSIMWalletClass.js +33 -0
  17. package/dist/esm/interface/eSIMWalletFactoryClass.js +21 -0
  18. package/dist/esm/interface/lazyWalletRegistryClass.js +19 -0
  19. package/{src/interface/smartAccountClass.ts → dist/esm/interface/smartAccountClass.js} +3 -11
  20. package/dist/esm/interface/utilsClass.js +13 -0
  21. package/{src/logic/P256Verifier.ts → dist/esm/logic/P256Verifier.js} +6 -17
  22. package/dist/esm/logic/account-kit/createSmartAccount.js +299 -0
  23. package/{src/logic/constants.ts → dist/esm/logic/constants.js} +42 -103
  24. package/{src/logic/deviceWallet.ts → dist/esm/logic/deviceWallet.js} +46 -74
  25. package/{src/logic/deviceWalletFactory.ts → dist/esm/logic/deviceWalletFactory.js} +22 -43
  26. package/{src/logic/eSIMWallet.ts → dist/esm/logic/eSIMWallet.js} +41 -59
  27. package/{src/logic/eSIMWalletFactory.ts → dist/esm/logic/eSIMWalletFactory.js} +28 -41
  28. package/{src/logic/lazyWalletRegistry.ts → dist/esm/logic/lazyWalletRegistry.js} +29 -60
  29. package/dist/esm/logic/utils.js +100 -0
  30. package/dist/esm/types-export.js +1 -0
  31. package/dist/esm/types.js +1 -0
  32. package/dist/types/abis/BeaconProxy.d.ts +3 -0
  33. package/dist/types/abis/DeviceWallet.d.ts +3 -0
  34. package/dist/types/abis/DeviceWalletFactory.d.ts +3 -0
  35. package/dist/types/abis/ESIMWallet.d.ts +3 -0
  36. package/dist/types/abis/ESIMWalletFactory.d.ts +3 -0
  37. package/dist/types/abis/LazyWalletRegistry.d.ts +3 -0
  38. package/dist/types/abis/P256Verifier.d.ts +3 -0
  39. package/dist/types/abis/Registry.d.ts +3 -0
  40. package/dist/types/abis/RegistryHelper.d.ts +3 -0
  41. package/dist/types/abis/index.d.ts +10 -0
  42. package/dist/types/config.d.ts +27 -0
  43. package/dist/types/interface/P256VerifierClass.d.ts +7 -0
  44. package/dist/types/interface/constantsClass.d.ts +7 -0
  45. package/dist/types/interface/deviceWalletClass.d.ts +2577 -0
  46. package/dist/types/interface/deviceWalletFactoryClass.d.ts +2570 -0
  47. package/dist/types/interface/eSIMWalletClass.d.ts +16 -0
  48. package/dist/types/interface/eSIMWalletFactoryClass.d.ts +2571 -0
  49. package/dist/types/interface/lazyWalletRegistryClass.d.ts +11 -0
  50. package/dist/types/interface/smartAccountClass.d.ts +2574 -0
  51. package/dist/types/interface/utilsClass.d.ts +2567 -0
  52. package/dist/types/logic/P256Verifier.d.ts +3 -0
  53. package/dist/types/logic/account-kit/createSmartAccount.d.ts +6 -0
  54. package/dist/types/logic/constants.d.ts +32 -0
  55. package/dist/types/logic/deviceWallet.d.ts +12 -0
  56. package/dist/types/logic/deviceWalletFactory.d.ts +5 -0
  57. package/dist/types/logic/eSIMWallet.d.ts +11 -0
  58. package/dist/types/logic/eSIMWalletFactory.d.ts +6 -0
  59. package/dist/types/logic/lazyWalletRegistry.d.ts +7 -0
  60. package/dist/types/logic/utils.d.ts +18 -0
  61. package/dist/types/types-export.d.ts +1 -0
  62. package/{src/types.ts → dist/types/types.d.ts} +19 -21
  63. package/package.json +20 -14
  64. package/.github/workflows/npm_publish.yaml +0 -45
  65. package/src/abis/DeviceWallet.json +0 -912
  66. package/src/abis/index.ts +0 -21
  67. package/src/config.ts +0 -58
  68. package/src/interface/P256VerifierClass.ts +0 -19
  69. package/src/interface/constantsClass.ts +0 -36
  70. package/src/interface/deviceWalletFactoryClass.ts +0 -35
  71. package/src/interface/eSIMWalletClass.ts +0 -55
  72. package/src/interface/eSIMWalletFactoryClass.ts +0 -36
  73. package/src/interface/lazyWalletRegistryClass.ts +0 -34
  74. package/src/interface/utilsClass.ts +0 -21
  75. package/src/logic/account-kit/createSmartAccount.ts +0 -401
  76. package/src/logic/utils.ts +0 -123
  77. package/src/types-export.ts +0 -7
  78. package/tsconfig.json +0 -114
@@ -0,0 +1,3 @@
1
+ import { WebAuthnSignature } from "../types.js";
2
+ import { SmartAccountClient } from "@aa-sdk/core";
3
+ export declare const _verifySignature: (client: SmartAccountClient, message: string, requireMessageVerification: boolean, webAuthnSignature: WebAuthnSignature, x: bigint, y: bigint) => Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
@@ -0,0 +1,6 @@
1
+ import { SmartContractAccount, SmartAccountClient } from "@aa-sdk/core";
2
+ import { WalletClient, Hex } from "viem";
3
+ import { P256Key, WebAuthnSignature } from "../../types.js";
4
+ export declare const _stamp: (credentialId: string, rpId: string, payload: Hex) => Promise<WebAuthnSignature>;
5
+ export declare const _getSmartWallet: (client: WalletClient, credentialId: string, rpId: string, organiationId: string, deviceUniqueIdentifier: string, deviceWalletOwnerKey: P256Key, salt: bigint) => Promise<SmartContractAccount>;
6
+ export declare const _getSmartWalletClient: (client: WalletClient, pimlicoAPIKey: string, gasPolicyId: string, account: SmartContractAccount) => Promise<SmartAccountClient>;
@@ -0,0 +1,32 @@
1
+ import { WalletClient, Address } from 'viem';
2
+ import { mainnet, sepolia, optimism, optimismSepolia, arbitrum, arbitrumSepolia, base, baseSepolia } from "viem/chains";
3
+ export declare const ZERO: bigint;
4
+ export declare const SIGNATURE_VALIDITY_SECONDS = 180;
5
+ export declare enum CHAIN_ID {
6
+ MAINNET = 1,
7
+ SEPOLIA = 11155111,
8
+ OPTIMISM_MAINNET = 10,
9
+ OPTIMISM_SEPOLIA = 11155420,
10
+ BASE_MAINNET = 8453,
11
+ BASE_SEPOLIA = 84532,
12
+ ARBITRUM_ONE = 42161,
13
+ ARBITRUM_SEPOLIA = 421614
14
+ }
15
+ export interface chainSpecifcConstants {
16
+ factoryAddresses: typeof sepoliaFactoryAddresses | typeof mainnetFactoryAddresses | typeof optimismMainnetFactoryAddresses | typeof optimismSepoliaFactoryAddresses | typeof baseMainnetFactoryAddresses | typeof baseSepoliaFactoryAddresses | typeof arbitrumOneFactoryAddresses | typeof arbitrumSepoliaFactoryAddresses;
17
+ chain: typeof mainnet | typeof sepolia | typeof optimism | typeof optimismSepolia | typeof base | typeof baseSepolia | typeof arbitrum | typeof arbitrumSepolia;
18
+ rpcURL: string;
19
+ pimlicoRpcURL: string;
20
+ customErrors: typeof customErrors;
21
+ }
22
+ export declare const sepoliaFactoryAddresses: Record<string, Address>;
23
+ export declare const mainnetFactoryAddresses: Record<string, Address>;
24
+ export declare const optimismMainnetFactoryAddresses: Record<string, Address>;
25
+ export declare const optimismSepoliaFactoryAddresses: Record<string, Address>;
26
+ export declare const baseMainnetFactoryAddresses: Record<string, Address>;
27
+ export declare const baseSepoliaFactoryAddresses: Record<string, Address>;
28
+ export declare const arbitrumOneFactoryAddresses: Record<string, Address>;
29
+ export declare const arbitrumSepoliaFactoryAddresses: Record<string, Address>;
30
+ export declare const customErrors: Record<string, string>;
31
+ export declare const _extractChainID: (client: WalletClient) => Promise<number>;
32
+ export declare const _getChainSpecificConstants: (chainID: CHAIN_ID.SEPOLIA | CHAIN_ID.MAINNET | CHAIN_ID.OPTIMISM_MAINNET | CHAIN_ID.OPTIMISM_SEPOLIA | CHAIN_ID.BASE_MAINNET | CHAIN_ID.BASE_SEPOLIA | CHAIN_ID.ARBITRUM_ONE | CHAIN_ID.ARBITRUM_SEPOLIA, rpcURL: string, pimlicoAPIKey?: string) => chainSpecifcConstants;
@@ -0,0 +1,12 @@
1
+ import { Address, WalletClient } from "viem";
2
+ import { SmartAccountClient } from "@aa-sdk/core";
3
+ import { P256Key } from "../types.js";
4
+ export declare const _deployESIMWallet: (client: SmartAccountClient, address: Address, hasAccessToETH: boolean, salt: bigint) => Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
5
+ export declare const _setESIMUniqueIdentifierForAnESIMWallet: (client: SmartAccountClient, address: Address, eSIMWalletAddress: Address, eSIMUniqueIdentifier: string) => Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
6
+ export declare const _payETHForDataBundles: (client: SmartAccountClient, address: Address, amount: bigint) => Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
7
+ export declare const _pullETH: (client: SmartAccountClient, address: Address, amount: bigint) => Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
8
+ export declare const _getVaultAddress: (client: SmartAccountClient, address: Address) => Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
9
+ export declare const _toggleAccessToETH: (client: SmartAccountClient, address: Address, eSIMWalletAddress: Address, hasAccessToETH: boolean) => Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
10
+ export declare const _addESIMWallet: (client: SmartAccountClient, address: Address, eSIMWalletAddress: Address, hasAccessToETH: boolean) => Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
11
+ export declare const _removeESIMWallet: (client: SmartAccountClient, address: Address, eSIMWalletAddress: Address, hasAccessToETH: boolean) => Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
12
+ export declare const _getOwner: (client: WalletClient, address: Address) => Promise<P256Key>;
@@ -0,0 +1,5 @@
1
+ import { WalletClient } from "viem";
2
+ import { SmartAccountClient } from "@aa-sdk/core";
3
+ export declare const _createAccountWithEOA: (client: WalletClient, deviceUniqueIdentifier: string, deviceWalletOwnerKey: string, salt: bigint, depositAmount: bigint) => Promise<`0x${string}`>;
4
+ export declare const _getAddress: (client: SmartAccountClient, deviceUniqueIdentifier: string, deviceWalletOwnerKey: string, salt: bigint) => Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
5
+ export declare const _getCurrentDeviceWalletImplementation: (client: SmartAccountClient) => Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
@@ -0,0 +1,11 @@
1
+ import { Address } from "viem";
2
+ import { DataBundleDetails } from "../types.js";
3
+ import { SmartAccountClient } from "@aa-sdk/core";
4
+ export declare const _setESIMUniqueIdentifier: (client: SmartAccountClient, address: Address, eSIMUniqueIdentifier: string) => Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
5
+ export declare const _buyDataBundle: (client: SmartAccountClient, address: Address, dataBundleDetails: DataBundleDetails) => Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
6
+ export declare const _populateHistory: (client: SmartAccountClient, address: Address, dataBundleDetails: Array<DataBundleDetails>) => Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
7
+ export declare const _owner: (client: SmartAccountClient, address: Address) => Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
8
+ export declare const _requestTransferOwnership: (client: SmartAccountClient, address: Address, newOwner: Address) => Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
9
+ export declare const _acceptOwnershipTransfer: (client: SmartAccountClient, address: Address) => Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
10
+ export declare const _sendETHToDeviceWallet: (client: SmartAccountClient, address: Address, amount: bigint) => Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
11
+ export declare const _transferOwnership: (client: SmartAccountClient, address: Address, amount: bigint) => Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
@@ -0,0 +1,6 @@
1
+ import { Address, WalletClient } from "viem";
2
+ import { SmartAccountClient } from "@aa-sdk/core";
3
+ export declare const _addRegistryAddress: (client: SmartAccountClient, registryContractAddress: Address) => Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
4
+ export declare const _deployESIMWalletWithEOA: (client: WalletClient, deviceWalletAddress: Address, salt: bigint) => Promise<`0x${string}`>;
5
+ export declare const _deployESIMWalletWithUserOp: (client: SmartAccountClient, deviceWalletAddress: Address, salt: bigint) => Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
6
+ export declare const _getCurrentESIMWalletImplementation: (client: SmartAccountClient) => Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
@@ -0,0 +1,7 @@
1
+ import { Hex } from "viem";
2
+ import { DataBundleDetails } from "../types.js";
3
+ import { SmartAccountClient } from "@aa-sdk/core";
4
+ export declare const _isLazyWalletDeployed: (client: SmartAccountClient, deviceUniqueIdentifier: string) => Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
5
+ export declare const _batchPopulateHistory: (client: SmartAccountClient, deviceUniqueIdentifiers: Array<string>, eSIMUniqueIdentifiers: Array<Array<string>>, dataBundleDetails: Array<Array<DataBundleDetails>>) => Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
6
+ export declare const _deployLazyWalletAndSetESIMIdentifier: (client: SmartAccountClient, deviceOwnerPublicKey: Hex[2], deviceUniqueIdentifier: string, salt: bigint, depositAmount: bigint) => Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
7
+ export declare const _switchESIMIdentifierToNewDeviceIdentifier: (client: SmartAccountClient, eSIMIdentifier: string, oldDeviceIdentifier: string, newDeviceIdentifier: string) => Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
@@ -0,0 +1,18 @@
1
+ import { Hex } from "viem";
2
+ export declare const _add0x: (data: Hex | string) => Hex;
3
+ export declare const _remove0x: (data: Hex | string) => string;
4
+ export declare function _shouldRemoveLeadingZero(bytes: Uint8Array): boolean;
5
+ export declare function _concatUint8Arrays(arrays: Uint8Array[]): Uint8Array;
6
+ export declare function base64UrlToBuffer(base64url: string): Buffer;
7
+ export declare function decodeClientDataJSON(base64url: string): any;
8
+ export declare function hexToArrayBuffer(hexString: string): ArrayBuffer;
9
+ export declare function parseDEREncodedSignature(signature: Uint8Array): {
10
+ r: string;
11
+ s: string;
12
+ };
13
+ export declare function shouldRemoveLeadingZero(bytes: Uint8Array): boolean;
14
+ export declare function concatUint8Arrays(arrays: Uint8Array[]): Uint8Array;
15
+ export declare function parseSignature(signature: Uint8Array): {
16
+ r: `0x${string}`;
17
+ s: `0x${string}`;
18
+ };
@@ -0,0 +1 @@
1
+ export type { P256Key, WebAuthnSignature, P256Credential, DataBundleDetails, SignedRequest } from './types';
@@ -1,38 +1,36 @@
1
1
  import { Hex } from "viem";
2
-
3
2
  export type P256Key = [Hex, Hex];
4
-
5
3
  export type WebAuthnSignature = {
6
- authenticatorData: Hex,
7
- clientDataJSON: string,
8
- challengeIndex: bigint,
9
- typeIndex: bigint,
10
- r: bigint,
11
- s: bigint
12
- }
13
-
4
+ authenticatorData: Hex;
5
+ clientDataJSON: string;
6
+ challengeIndex: bigint;
7
+ typeIndex: bigint;
8
+ r: bigint;
9
+ s: bigint;
10
+ };
14
11
  export type P256Credential = {
15
12
  rawId: Hex;
16
13
  clientData: {
17
- type: string;
18
- challenge: string;
19
- origin: string;
20
- crossOrigin: boolean;
14
+ type: string;
15
+ challenge: string;
16
+ origin: string;
17
+ crossOrigin: boolean;
21
18
  };
22
19
  authenticatorData: Hex;
23
- signature: {r: Hex, s: Hex};
20
+ signature: {
21
+ r: Hex;
22
+ s: Hex;
23
+ };
24
24
  };
25
-
26
25
  export type DataBundleDetails = {
27
26
  dataBundleId: string;
28
27
  dataBundlePrice: bigint;
29
- }
30
-
28
+ };
31
29
  export type SignedRequest = {
32
30
  body: string;
33
- stamp : {
31
+ stamp: {
34
32
  stampHeader: string;
35
33
  stampHeaderValue: string;
36
- }
34
+ };
37
35
  url: string;
38
- }
36
+ };
package/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "kokio-sdk",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./dist/esm/config.js",
7
+ "files": [
8
+ "dist"
9
+ ],
7
10
  "exports": {
8
11
  ".": {
9
12
  "types": "./dist/types/config.d.ts",
@@ -17,7 +20,8 @@
17
20
  "./package.json": "./package.json"
18
21
  },
19
22
  "scripts": {
20
- "postinstall": "tsc && cp ./src/abis/*.json ./dist/esm/abis/",
23
+ "build": "tsc",
24
+ "prepack": "npm run build",
21
25
  "test": "echo \"Error: no test specified\" && exit 1"
22
26
  },
23
27
  "repository": {
@@ -25,7 +29,7 @@
25
29
  "url": "git+https://github.com/Blockchain-Powered-eSIM/kokio-sdk.git"
26
30
  },
27
31
  "author": "",
28
- "license": "ISC",
32
+ "license": "MIT",
29
33
  "bugs": {
30
34
  "url": "https://github.com/Blockchain-Powered-eSIM/kokio-sdk/issues"
31
35
  },
@@ -35,16 +39,18 @@
35
39
  "typescript": "^5.7.3"
36
40
  },
37
41
  "dependencies": {
38
- "@aa-sdk/core": "^4.14.0",
39
- "@account-kit/core": "^4.13.0",
40
- "@account-kit/infra": "^4.15.3",
41
- "@account-kit/signer": "^4.14.0",
42
- "@noble/curves": "^2.2.0",
43
- "@peculiar/asn1-ecc": "^2.3.15",
44
- "@peculiar/asn1-schema": "^2.3.15",
45
- "@simplewebauthn/server": "^13.1.1",
46
- "ethers": "^6.13.5",
47
- "react-native-passkey": "^3.1.0",
48
- "viem": "^2.23.5"
42
+ "@aa-sdk/core": "4.88.4",
43
+ "@account-kit/infra": "4.88.4",
44
+ "@noble/curves": "2.2.0",
45
+ "@peculiar/asn1-ecc": "2.8.0",
46
+ "@peculiar/asn1-schema": "2.8.0",
47
+ "@simplewebauthn/server": "13.3.2",
48
+ "react-native-passkey": "3.5.0",
49
+ "viem": "2.53.1"
50
+ },
51
+ "overrides": {
52
+ "ws": "8.21.0",
53
+ "uuid": "14.0.0",
54
+ "js-cookie": "3.0.8"
49
55
  }
50
56
  }
@@ -1,45 +0,0 @@
1
- name: Publish SDK
2
-
3
- on:
4
- push:
5
- branches: [ "main" ]
6
-
7
- permissions:
8
- id-token: write
9
- contents: write
10
-
11
- jobs:
12
- publish-npm:
13
- if: contains(github.event.head_commit.message, 'Release')
14
- runs-on: ubuntu-latest
15
-
16
- steps:
17
- - uses: actions/checkout@v4
18
-
19
- - uses: actions/setup-node@v4
20
- with:
21
- node-version: 24
22
- registry-url: 'https://registry.npmjs.org/'
23
-
24
- - name: Get version from package.json
25
- id: pkg
26
- run: |
27
- VERSION=$(node -p "require('./package.json').version")
28
- echo "version=$VERSION" >> $GITHUB_OUTPUT
29
-
30
- - name: Install deps (also runs postinstall)
31
- run: npm install -g npm@latest
32
-
33
- - name: Publish to npm
34
- run: npm publish --access public
35
-
36
- - name: Create Git tag
37
- run: |
38
- git tag v${{ steps.pkg.outputs.version }}
39
- git push origin v${{ steps.pkg.outputs.version }}
40
-
41
- - name: Create GitHub Release
42
- uses: softprops/action-gh-release@v2
43
- with:
44
- tag_name: v${{ steps.pkg.outputs.version }}
45
- generate_release_notes: true