semantic-release-pub 0.10.10 → 0.10.12
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.
- package/dist/index.js +1 -1
- package/dist/publish.js +4 -0
- package/dist/utils.js +5 -1
- package/package.json +11 -7
- package/dist/index.d.ts +0 -4
- package/dist/prepare.d.ts +0 -3
- package/dist/publish.d.ts +0 -6
- package/dist/schemas.d.ts +0 -23
- package/dist/types.d.ts +0 -6
- package/dist/utils.d.ts +0 -14
- package/dist/verifyConditions.d.ts +0 -3
package/dist/index.js
CHANGED
package/dist/publish.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import SemanticReleaseError from "@semantic-release/error";
|
|
1
2
|
import { execa } from "execa";
|
|
2
3
|
import { getConfig, getGithubIdentityToken, getGoogleIdentityToken, getPubspec, } from "./utils.js";
|
|
3
4
|
const SEMANTIC_RELEASE_PUB_TOKEN = "SEMANTIC_RELEASE_PUB_TOKEN";
|
|
@@ -25,6 +26,9 @@ const getPubToken = async (useGithubOidc, logger) => {
|
|
|
25
26
|
}
|
|
26
27
|
logger.log("Using Google identity token to publish to pub.dev");
|
|
27
28
|
const { GOOGLE_SERVICE_ACCOUNT_KEY } = process.env;
|
|
29
|
+
if (!GOOGLE_SERVICE_ACCOUNT_KEY) {
|
|
30
|
+
throw new SemanticReleaseError("Environment variable not found: GOOGLE_SERVICE_ACCOUNT_KEY");
|
|
31
|
+
}
|
|
28
32
|
return await getGoogleIdentityToken(GOOGLE_SERVICE_ACCOUNT_KEY);
|
|
29
33
|
};
|
|
30
34
|
const setPubToken = async (cli, idToken) => {
|
package/dist/utils.js
CHANGED
|
@@ -17,7 +17,11 @@ export const getConfig = (config) => {
|
|
|
17
17
|
};
|
|
18
18
|
export const getGoogleIdentityToken = async (serviceAccountStr) => {
|
|
19
19
|
const serviceAccountJson = getServiceAccount(serviceAccountStr);
|
|
20
|
-
const jwtClient = new JWT(
|
|
20
|
+
const jwtClient = new JWT({
|
|
21
|
+
email: serviceAccountJson.client_email,
|
|
22
|
+
key: serviceAccountJson.private_key,
|
|
23
|
+
scopes: PUB_DEV_AUDIENCE,
|
|
24
|
+
});
|
|
21
25
|
const creds = await jwtClient.authorize();
|
|
22
26
|
if (!creds.id_token) {
|
|
23
27
|
throw new SemanticReleaseError("Failed to retrieve identity token from Google");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "semantic-release-pub",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.12",
|
|
4
4
|
"description": "semantic-release plugin to publish a Dart or Flutter package",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"author": "zeshuaro@gmail.com",
|
|
@@ -25,34 +25,38 @@
|
|
|
25
25
|
"scripts": {
|
|
26
26
|
"build": "tsc",
|
|
27
27
|
"test": "vitest run tests --coverage",
|
|
28
|
-
"lint": "biome check src tests",
|
|
28
|
+
"lint": "biome check src tests && tsc --noEmit && tsc -p tsconfig.test.json",
|
|
29
29
|
"lint:write": "biome check src tests --write"
|
|
30
30
|
},
|
|
31
31
|
"engines": {
|
|
32
|
-
"node": ">=22.
|
|
32
|
+
"node": ">=22.17.0"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@actions/core": "^1.11.1",
|
|
36
36
|
"@semantic-release/error": "^4.0.0",
|
|
37
37
|
"execa": "^9.6.0",
|
|
38
|
-
"google-auth-library": "^
|
|
38
|
+
"google-auth-library": "^10.1.0",
|
|
39
39
|
"yaml": "^2.8.0",
|
|
40
|
-
"zod": "^3.25.
|
|
40
|
+
"zod": "^3.25.67"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@biomejs/biome": "1.9.4",
|
|
44
44
|
"@semantic-release/changelog": "6.0.3",
|
|
45
45
|
"@semantic-release/git": "10.0.1",
|
|
46
|
+
"@tsconfig/node-ts": "^23.6.1",
|
|
47
|
+
"@tsconfig/node22": "^22.0.2",
|
|
48
|
+
"@tsconfig/recommended": "^1.0.10",
|
|
49
|
+
"@tsconfig/strictest": "^2.0.5",
|
|
46
50
|
"@types/common-tags": "1.8.4",
|
|
47
51
|
"@types/semantic-release": "20.0.6",
|
|
48
52
|
"@types/semantic-release__error": "3.0.3",
|
|
49
53
|
"@types/signale": "1.4.7",
|
|
50
|
-
"@vitest/coverage-v8": "3.2.
|
|
54
|
+
"@vitest/coverage-v8": "3.2.4",
|
|
51
55
|
"common-tags": "1.8.2",
|
|
52
56
|
"conventional-changelog-conventionalcommits": "9.0.0",
|
|
53
57
|
"semantic-release": "24.2.5",
|
|
54
58
|
"typescript": "5.8.3",
|
|
55
|
-
"vitest": "3.2.
|
|
59
|
+
"vitest": "3.2.4",
|
|
56
60
|
"vitest-mock-extended": "3.1.0"
|
|
57
61
|
}
|
|
58
62
|
}
|
package/dist/index.d.ts
DELETED
package/dist/prepare.d.ts
DELETED
package/dist/publish.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { PublishContext } from "semantic-release";
|
|
2
|
-
import type { PluginConfig } from "./types.js";
|
|
3
|
-
export declare const publish: (pluginConfig: PluginConfig, { nextRelease: { version }, logger }: PublishContext) => Promise<{
|
|
4
|
-
name: string;
|
|
5
|
-
url: string;
|
|
6
|
-
}>;
|
package/dist/schemas.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const ServiceAccount: z.ZodObject<{
|
|
3
|
-
client_email: z.ZodString;
|
|
4
|
-
private_key: z.ZodString;
|
|
5
|
-
}, "strip", z.ZodTypeAny, {
|
|
6
|
-
client_email?: string;
|
|
7
|
-
private_key?: string;
|
|
8
|
-
}, {
|
|
9
|
-
client_email?: string;
|
|
10
|
-
private_key?: string;
|
|
11
|
-
}>;
|
|
12
|
-
export type ServiceAccount = z.infer<typeof ServiceAccount>;
|
|
13
|
-
export declare const Pubspec: z.ZodObject<{
|
|
14
|
-
name: z.ZodString;
|
|
15
|
-
version: z.ZodString;
|
|
16
|
-
}, "strip", z.ZodTypeAny, {
|
|
17
|
-
name?: string;
|
|
18
|
-
version?: string;
|
|
19
|
-
}, {
|
|
20
|
-
name?: string;
|
|
21
|
-
version?: string;
|
|
22
|
-
}>;
|
|
23
|
-
export type Pubspec = z.infer<typeof Pubspec>;
|
package/dist/types.d.ts
DELETED
package/dist/utils.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { PluginConfig } from "./types.js";
|
|
2
|
-
export declare const PUBSPEC_PATH = "pubspec.yaml";
|
|
3
|
-
export declare const getConfig: (config: PluginConfig) => PluginConfig;
|
|
4
|
-
export declare const getGoogleIdentityToken: (serviceAccountStr: string) => Promise<string>;
|
|
5
|
-
export declare const getGithubIdentityToken: () => Promise<string>;
|
|
6
|
-
export declare const getPubspecString: () => string;
|
|
7
|
-
export declare const getPubspecFromString: (data: string) => {
|
|
8
|
-
name?: string;
|
|
9
|
-
version?: string;
|
|
10
|
-
};
|
|
11
|
-
export declare const getPubspec: () => {
|
|
12
|
-
name?: string;
|
|
13
|
-
version?: string;
|
|
14
|
-
};
|