@wtf/semantic-release-oci 2.1.0 → 3.0.0
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/README.md +17 -6
- package/dist/index.d.ts +24 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +143 -76
- package/dist/index.js.map +1 -1
- package/dist/schema.d.ts +4 -4
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +4 -3
- package/dist/schema.js.map +1 -1
- package/package.json +8 -4
package/README.md
CHANGED
|
@@ -36,16 +36,27 @@ export default {
|
|
|
36
36
|
`CI_REGISTRY_IMAGE` of the run (`EOCIIMAGE`). Then it asks GitLab once, with no effect, whether the
|
|
37
37
|
run's token may read the API of the container registry, which the links need (`EOCILINK`). A dry
|
|
38
38
|
run of no token, as of a merge request, only says so. It asks crane nothing.
|
|
39
|
-
- `
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
- `verifyRelease` runs the step `verify` of the ecosystem of OCI images of `@wtf/release-oci`, by
|
|
40
|
+
`runStep` of `@wtf/release/driver`, once the version is known: it checks the version and its
|
|
41
|
+
tags, and the repository of each image of the train.
|
|
42
|
+
- `publish` runs the steps `publish` and `move` of the ecosystem, over the plan of the train: it
|
|
43
|
+
finds the tested image of each image,
|
|
44
|
+
`<sourceRepository>:<sourceTag>`, by its digest, of the platforms of `platforms` (`EOCISMOKE`);
|
|
45
|
+
copies it by crane to the tag of the version; and of a release, points its minor and its major,
|
|
46
|
+
which move, at the digest of the version. A version the registry has at the same digest is
|
|
47
|
+
skipped, so a release that stopped part way is finished by running it again; at another digest it
|
|
48
|
+
is refused, and nothing is copied (`EOCIRETAG`). It records each image for the links of the
|
|
44
49
|
GitLab release of the tag, which
|
|
45
50
|
`['@wtf/semantic-release-trains', { wrap: '@semantic-release/gitlab' }]` makes: its page in the
|
|
46
51
|
container registry of the project, which the Container Registry API names (`EOCILINK`).
|
|
47
52
|
|
|
48
|
-
|
|
53
|
+
The plugin names the tags that move of a version, as semantic-release's versions are: `1.4` and `1`
|
|
54
|
+
of `1.4.2`, `0.3` alone of `0.3.1`, as a minor of `0` breaks what the one before gave, and none of
|
|
55
|
+
a prerelease, as `8.0.0-next.1`, nor of the option `moving: false`.
|
|
56
|
+
|
|
57
|
+
A dry run runs `verifyConditions` and `verifyRelease` alone of these, so it copies nothing. What
|
|
58
|
+
the plugin says in the log of a step of the release, and each error of it, names the train, as
|
|
59
|
+
`[train base] …`.
|
|
49
60
|
|
|
50
61
|
The links need a token of GitLab's API, `GITLAB_TOKEN` or `GL_TOKEN` of the `read_api` or `api`
|
|
51
62
|
scope, protected and masked, as semantic-release takes it to push the release: the API of the
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { SystemInput } from '@wtf/release-system';
|
|
2
1
|
import type { Trains } from '@wtf/release-trains';
|
|
3
|
-
import type { PublishContext, VerifyConditionsContext } from 'semantic-release';
|
|
2
|
+
import type { PublishContext, VerifyConditionsContext, VerifyReleaseContext } from 'semantic-release';
|
|
4
3
|
/** The options of the plugin, in the config of semantic-release or at its root. */
|
|
5
4
|
export interface OciPluginOptions {
|
|
6
5
|
/** Every train of the repo: the images of each are those whose folder its paths hold. */
|
|
@@ -41,8 +40,6 @@ export interface OciPluginOptions {
|
|
|
41
40
|
* `false`.
|
|
42
41
|
*/
|
|
43
42
|
readonly dotenv?: string | false | undefined;
|
|
44
|
-
/** The system the plugin runs by, over Node's. */
|
|
45
|
-
readonly system?: SystemInput;
|
|
46
43
|
}
|
|
47
44
|
/** The release the plugin gives semantic-release of the images copied. */
|
|
48
45
|
export interface OciRelease {
|
|
@@ -69,14 +66,26 @@ type OfRun = {
|
|
|
69
66
|
* @param context - The context of semantic-release's `verifyConditions` step: the folder, the
|
|
70
67
|
* environment and the logger of the run.
|
|
71
68
|
*/
|
|
72
|
-
export declare
|
|
69
|
+
export declare const verifyConditions: (pluginConfig: OciPluginOptions, context: VerifyConditionsContext & OfRun) => Promise<void>;
|
|
73
70
|
/**
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
71
|
+
* Runs the step `verify` of the ecosystem of OCI images, once semantic-release knows the version of
|
|
72
|
+
* the release: that the version and each tag that moves of it is a tag of an image, none given
|
|
73
|
+
* twice (`EOCIVERSION`), and that each image of the train has a repository (`EOCIIMAGE`). It asks
|
|
74
|
+
* the registry nothing. What it says and throws names the train.
|
|
75
|
+
*
|
|
76
|
+
* @param pluginConfig - The plugin's options of the config, with `trains` of its root.
|
|
77
|
+
* @param context - The context of semantic-release's `verifyRelease` step: the folder, the
|
|
78
|
+
* environment and the logger of the run, and the next release.
|
|
79
|
+
*/
|
|
80
|
+
export declare const verifyRelease: (pluginConfig: OciPluginOptions, context: VerifyReleaseContext & OfRun) => Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* Copies the tested image of each image of the release to the tags of the release, by the steps
|
|
83
|
+
* `publish` and `move` of the ecosystem of OCI images, which `verifyRelease` verified: its version, skipped of a registry
|
|
84
|
+
* that has it at the same digest, so a release that stopped part way is finished by running it
|
|
85
|
+
* again; and of a release, its minor and its major, pointed at the version. Each image is given its
|
|
86
|
+
* page in the container registry of GitLab, asked by a token of `GL_TOKEN` or `GITLAB_TOKEN`, and
|
|
87
|
+
* recorded for the links of the release of the host; and the images it published are written to
|
|
88
|
+
* the dotenv file of `dotenv`.
|
|
80
89
|
*
|
|
81
90
|
* @param pluginConfig - The plugin's options of the config, with `trains` of its root.
|
|
82
91
|
* @param context - The context of semantic-release's `publish` step: the folder, the environment,
|
|
@@ -87,10 +96,11 @@ export declare function verifyConditions(pluginConfig: OciPluginOptions, context
|
|
|
87
96
|
* `EOCISMOKE` of a tested image the registry has not, `EOCIRETAG` of a version the registry has at
|
|
88
97
|
* another digest, `EOCITAG` of a copy crane cannot make, `EOCILINK` of a page GitLab cannot give.
|
|
89
98
|
*/
|
|
90
|
-
export declare
|
|
99
|
+
export declare const publish: (pluginConfig: OciPluginOptions, context: PublishContext & OfRun) => Promise<OciRelease | false>;
|
|
91
100
|
declare const _default: {
|
|
92
|
-
verifyConditions:
|
|
93
|
-
|
|
101
|
+
verifyConditions: (pluginConfig: OciPluginOptions, context: VerifyConditionsContext & OfRun) => Promise<void>;
|
|
102
|
+
verifyRelease: (pluginConfig: OciPluginOptions, context: VerifyReleaseContext & OfRun) => Promise<void>;
|
|
103
|
+
publish: (pluginConfig: OciPluginOptions, context: PublishContext & OfRun) => Promise<OciRelease | false>;
|
|
94
104
|
};
|
|
95
105
|
export default _default;
|
|
96
106
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAmEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AASjD,OAAO,KAAK,EACV,cAAc,EACd,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,kBAAkB,CAAA;AAKzB,mFAAmF;AACnF,MAAM,WAAW,gBAAgB;IAC/B,yFAAyF;IACzF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB;;;;OAIG;IACH,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAA;IACtC,sFAAsF;IACtF,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC;;;OAGG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC9C;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,S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AuB,GAAG,KAAK,KACrC,OAAO,CAAC,IAAI,CAAC;kCAyDF,gBAAgB,WACrB,oBAAoB,GAAG,KAAK,KAClC,OAAO,CAAC,IAAI,CAAC;4BA+BF,gBAAgB,WACrB,cAAc,GAAG,KAAK,KAC5B,OAAO,CAAC,UAAU,GAAG,KAAK,CAAC;;AA6DhC,wBAA2D"}
|
package/dist/index.js
CHANGED
|
@@ -1,38 +1,65 @@
|
|
|
1
|
-
import { packagesOfImages } from '@wtf/release-oci/ecosystem';
|
|
1
|
+
import { ociEcosystem, packagesOfImages } from '@wtf/release-oci/ecosystem';
|
|
2
2
|
import { OciError } from '@wtf/release-oci/errors';
|
|
3
3
|
import { readImages, registryImageOf } from '@wtf/release-oci/images';
|
|
4
|
-
import {
|
|
5
|
-
import { checkRegistryAccess
|
|
6
|
-
import {
|
|
7
|
-
import { throwAll } from '@wtf/release
|
|
8
|
-
import {
|
|
9
|
-
import { joinPath } from '@wtf/release
|
|
10
|
-
import { errorsOf } from '@wtf/release
|
|
4
|
+
import { digestOf } from '@wtf/release-oci/publish';
|
|
5
|
+
import { checkRegistryAccess } from '@wtf/release-oci/registry';
|
|
6
|
+
import { runStep } from '@wtf/release/driver';
|
|
7
|
+
import { throwAll } from '@wtf/release/errors';
|
|
8
|
+
import { writeFile } from '@wtf/release/files';
|
|
9
|
+
import { joinPath } from '@wtf/release/posix';
|
|
10
|
+
import { errorsOf } from '@wtf/release/validator';
|
|
11
11
|
import { gitlabProjectOf } from '@wtf/release-trains/gitlab';
|
|
12
|
-
import {
|
|
12
|
+
import { planOf } from '@wtf/release-trains/plan';
|
|
13
|
+
import { recordReleased } from '@wtf/semantic-release/links';
|
|
13
14
|
import { ownersOf } from '@wtf/release-trains/packages';
|
|
14
15
|
import { selectTrain, trainOfRun } from '@wtf/release-trains/trains';
|
|
16
|
+
import { runOf } from '@wtf/semantic-release';
|
|
17
|
+
import { markedStep } from '@wtf/semantic-release/errors';
|
|
18
|
+
import { inTrain, stepRelease } from '@wtf/semantic-release/release';
|
|
19
|
+
import semver from 'semver';
|
|
15
20
|
import { ociSchema } from "./schema.js";
|
|
16
|
-
/** The repository of the tested image of the image of `repository`, by its template. */
|
|
17
|
-
const sourceRepositoryOf = (template, repository) => template.replaceAll('{image}', repository);
|
|
18
21
|
/**
|
|
19
|
-
* The
|
|
22
|
+
* The tags of a release of `version`, as semantic-release's versions are: the version, and of a
|
|
23
|
+
* release, its minor and its major, which move, as `1.4` and `1` of `1.4.2`, which a consumer pins
|
|
24
|
+
* to take each fix of its line; of a release of the major `0`, its minor alone, as a minor of `0`
|
|
25
|
+
* breaks what the one before gave; of a prerelease, none that moves, so no moving tag points at a
|
|
26
|
+
* version that is not released.
|
|
27
|
+
*
|
|
28
|
+
* @param version - The version of the release, as `1.4.2`.
|
|
29
|
+
* @param moving - Whether a release moves its minor and its major: `true` by default.
|
|
30
|
+
* @returns The tags.
|
|
31
|
+
* @throws `TypeError` of a version that is no semver.
|
|
32
|
+
*/
|
|
33
|
+
function releaseTagsOf(version, moving = true) {
|
|
34
|
+
const parsed = semver.parse(version);
|
|
35
|
+
if (parsed === null)
|
|
36
|
+
throw new TypeError(`${version} is no semver version.`);
|
|
37
|
+
if (!moving || parsed.prerelease.length > 0)
|
|
38
|
+
return { version: parsed.version, moving: [] };
|
|
39
|
+
const minor = `${parsed.major}.${parsed.minor}`;
|
|
40
|
+
return {
|
|
41
|
+
version: parsed.version,
|
|
42
|
+
moving: parsed.major === 0 ? [minor] : [minor, `${parsed.major}`]
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The folder and the platform of the run, Node's, its train, and the images of the repo and of the
|
|
47
|
+
* train.
|
|
20
48
|
*
|
|
21
49
|
* @param pluginConfig - The plugin's options of the config.
|
|
22
50
|
* @param context - The folder and the environment of the run.
|
|
23
51
|
* @returns What a step reads of the run.
|
|
24
52
|
*/
|
|
25
53
|
async function releaseOf(pluginConfig, context) {
|
|
26
|
-
const
|
|
54
|
+
const repo = await runOf(context);
|
|
27
55
|
const [train] = selectTrain(pluginConfig.trains, trainOfRun(pluginConfig.train, context.env));
|
|
28
|
-
const
|
|
29
|
-
const images = await readImages(git, pluginConfig.image ?? registryImageOf(git));
|
|
56
|
+
const images = await readImages(repo, pluginConfig.image ?? registryImageOf(repo));
|
|
30
57
|
const packages = packagesOfImages(images);
|
|
31
58
|
const owners = ownersOf(pluginConfig.trains, packages);
|
|
32
59
|
const selected = packages
|
|
33
60
|
.filter(({ name }) => owners.get(name) === train)
|
|
34
61
|
.map(({ image }) => image);
|
|
35
|
-
return {
|
|
62
|
+
return { repo, train, packages, selected };
|
|
36
63
|
}
|
|
37
64
|
/**
|
|
38
65
|
* The modules of the ecosystem of OCI images, as `ecosystems` of a config names it: this plugin's
|
|
@@ -108,7 +135,7 @@ function nothingOf(release, context) {
|
|
|
108
135
|
* @param context - The context of semantic-release's `verifyConditions` step: the folder, the
|
|
109
136
|
* environment and the logger of the run.
|
|
110
137
|
*/
|
|
111
|
-
export
|
|
138
|
+
export const verifyConditions = markedStep(async (pluginConfig, context) => {
|
|
112
139
|
checkOptions(pluginConfig);
|
|
113
140
|
const release = await releaseOf(pluginConfig, context);
|
|
114
141
|
if (nothingOf(release, context))
|
|
@@ -125,15 +152,63 @@ export async function verifyConditions(pluginConfig, context) {
|
|
|
125
152
|
context.logger.log(`${error.message} A release of this run would fail here.`);
|
|
126
153
|
return;
|
|
127
154
|
}
|
|
128
|
-
await checkRegistryAccess({
|
|
129
|
-
|
|
155
|
+
await checkRegistryAccess({
|
|
156
|
+
fetch: release.repo.platform.fetch,
|
|
157
|
+
project: projectOf(context),
|
|
158
|
+
headers
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
/**
|
|
162
|
+
* The plan of the release of the train of `release`, of `version`, by `planOf` of
|
|
163
|
+
* `@wtf/release-trains/plan`: the images of the train, of their own type.
|
|
164
|
+
*
|
|
165
|
+
* @param pluginConfig - The plugin's options of the config, with `trains` of its root.
|
|
166
|
+
* @param release - What the step read of the run.
|
|
167
|
+
* @param version - The version of the release.
|
|
168
|
+
* @returns The plan of the images, by the name of the ecosystem.
|
|
169
|
+
*/
|
|
170
|
+
const plansOf = (pluginConfig, release, version) => planOf({
|
|
171
|
+
trains: pluginConfig.trains,
|
|
172
|
+
train: release.train,
|
|
173
|
+
version,
|
|
174
|
+
repo: [{ ecosystem: ociEcosystem, packages: release.packages }],
|
|
175
|
+
...release.repo
|
|
176
|
+
});
|
|
177
|
+
/**
|
|
178
|
+
* The tags that move to `version`, of the option `moving`: of a release, its minor and its major;
|
|
179
|
+
* none of a prerelease, or where the option is false.
|
|
180
|
+
*/
|
|
181
|
+
const movingOf = (pluginConfig, version) => releaseTagsOf(version, pluginConfig.moving ?? true).moving;
|
|
182
|
+
/**
|
|
183
|
+
* Runs the step `verify` of the ecosystem of OCI images, once semantic-release knows the version of
|
|
184
|
+
* the release: that the version and each tag that moves of it is a tag of an image, none given
|
|
185
|
+
* twice (`EOCIVERSION`), and that each image of the train has a repository (`EOCIIMAGE`). It asks
|
|
186
|
+
* the registry nothing. What it says and throws names the train.
|
|
187
|
+
*
|
|
188
|
+
* @param pluginConfig - The plugin's options of the config, with `trains` of its root.
|
|
189
|
+
* @param context - The context of semantic-release's `verifyRelease` step: the folder, the
|
|
190
|
+
* environment and the logger of the run, and the next release.
|
|
191
|
+
*/
|
|
192
|
+
export const verifyRelease = markedStep(async (pluginConfig, context) => {
|
|
193
|
+
const { version } = context.nextRelease;
|
|
194
|
+
const release = await releaseOf(pluginConfig, context);
|
|
195
|
+
if (nothingOf(release, context))
|
|
196
|
+
return;
|
|
197
|
+
await inTrain(release.train, async () => {
|
|
198
|
+
const of = stepRelease(context, { ...release.repo, train: release.train, version });
|
|
199
|
+
const plans = await plansOf(pluginConfig, release, version);
|
|
200
|
+
const options = { moving: movingOf(pluginConfig, version) };
|
|
201
|
+
await runStep(of, plans, [[ociEcosystem, options]], 'verify');
|
|
202
|
+
});
|
|
203
|
+
});
|
|
130
204
|
/**
|
|
131
|
-
* Copies the tested image of each image of the release to the tags of the release
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
* by a token of `GL_TOKEN` or `GITLAB_TOKEN
|
|
136
|
-
*
|
|
205
|
+
* Copies the tested image of each image of the release to the tags of the release, by the steps
|
|
206
|
+
* `publish` and `move` of the ecosystem of OCI images, which `verifyRelease` verified: its version, skipped of a registry
|
|
207
|
+
* that has it at the same digest, so a release that stopped part way is finished by running it
|
|
208
|
+
* again; and of a release, its minor and its major, pointed at the version. Each image is given its
|
|
209
|
+
* page in the container registry of GitLab, asked by a token of `GL_TOKEN` or `GITLAB_TOKEN`, and
|
|
210
|
+
* recorded for the links of the release of the host; and the images it published are written to
|
|
211
|
+
* the dotenv file of `dotenv`.
|
|
137
212
|
*
|
|
138
213
|
* @param pluginConfig - The plugin's options of the config, with `trains` of its root.
|
|
139
214
|
* @param context - The context of semantic-release's `publish` step: the folder, the environment,
|
|
@@ -144,7 +219,7 @@ export async function verifyConditions(pluginConfig, context) {
|
|
|
144
219
|
* `EOCISMOKE` of a tested image the registry has not, `EOCIRETAG` of a version the registry has at
|
|
145
220
|
* another digest, `EOCITAG` of a copy crane cannot make, `EOCILINK` of a page GitLab cannot give.
|
|
146
221
|
*/
|
|
147
|
-
export
|
|
222
|
+
export const publish = markedStep(async (pluginConfig, context) => {
|
|
148
223
|
const { version } = context.nextRelease;
|
|
149
224
|
const release = await releaseOf(pluginConfig, context);
|
|
150
225
|
const run = { cwd: context.cwd, train: release.train, version };
|
|
@@ -152,55 +227,47 @@ export async function publish(pluginConfig, context) {
|
|
|
152
227
|
recordReleased(run, 'oci', []);
|
|
153
228
|
return false;
|
|
154
229
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
230
|
+
return inTrain(release.train, async () => {
|
|
231
|
+
// Each image of a repository (`EOCIIMAGE`), before anything is asked.
|
|
232
|
+
repositoriesOf(release);
|
|
233
|
+
// The token of the links, before anything is copied: a run of none fails here, not after.
|
|
234
|
+
const headers = registryHeadersOf(context.env);
|
|
235
|
+
const tag = pluginConfig.sourceTag ?? context.env['CI_COMMIT_REF_SLUG'];
|
|
236
|
+
if (tag === undefined || tag === '')
|
|
237
|
+
throw new OciError('EOCISOURCE', `The tested image of train ${release.train} has no tag: neither the option \`sourceTag\` nor \`CI_COMMIT_REF_SLUG\` of the run names it.`, 'Run the release in the pipeline of its tag, which gives `CI_COMMIT_REF_SLUG`, or give the plugin the option `sourceTag`, the tag the pipeline pushes the tested image as.');
|
|
238
|
+
const { platform, root } = release.repo;
|
|
239
|
+
const plans = await plansOf(pluginConfig, release, version);
|
|
240
|
+
const options = {
|
|
241
|
+
moving: movingOf(pluginConfig, version),
|
|
242
|
+
source: { repository: pluginConfig.sourceRepository ?? '{image}/snapshot', tag },
|
|
243
|
+
platforms: pluginConfig.platforms,
|
|
244
|
+
crane: pluginConfig.crane,
|
|
245
|
+
registry: { project: projectOf(context), headers }
|
|
246
|
+
};
|
|
247
|
+
const of = stepRelease(context, { ...release.repo, train: release.train, version });
|
|
248
|
+
const { dryRun } = of;
|
|
249
|
+
const ecosystems = [[ociEcosystem, options]];
|
|
250
|
+
const { released } = await runStep(of, plans, ecosystems, 'publish');
|
|
251
|
+
await runStep(of, plans, ecosystems, 'move');
|
|
252
|
+
recordReleased(run, 'oci', released);
|
|
253
|
+
if (pluginConfig.dotenv !== false && !dryRun) {
|
|
254
|
+
const path = pluginConfig.dotenv ?? 'oci.env';
|
|
255
|
+
const file = joinPath(platform.dirs.cwd, path);
|
|
256
|
+
const crane = { platform, crane: pluginConfig.crane };
|
|
257
|
+
const images = await Promise.all(released.map(async ({ name }) => `${name}@${await digestOf(`${name}:${version}`, crane)}`));
|
|
258
|
+
await writeFile(root, path, [
|
|
259
|
+
`oci_version=${version}`,
|
|
260
|
+
`oci_images=${images.join(' ')}`,
|
|
261
|
+
`oci_tags=${released.length === 0 ? '' : [version, ...options.moving].join(' ')}`
|
|
262
|
+
].join('\n') + '\n');
|
|
263
|
+
of.log(`Wrote the images published to ${file}.`);
|
|
264
|
+
}
|
|
265
|
+
const [first] = released;
|
|
266
|
+
return {
|
|
267
|
+
name: `OCI images (${released.map(({ name }) => `${name}:${version}`).join(', ')})`,
|
|
268
|
+
...(first?.page === undefined ? {} : { url: first.page })
|
|
269
|
+
};
|
|
180
270
|
});
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
const released = published.map(({ repository }, index) => ({
|
|
184
|
-
ecosystem: 'oci',
|
|
185
|
-
name: repository,
|
|
186
|
-
version,
|
|
187
|
-
page: pages[index]
|
|
188
|
-
}));
|
|
189
|
-
recordReleased(run, 'oci', released);
|
|
190
|
-
if (pluginConfig.dotenv !== false) {
|
|
191
|
-
const file = joinPath(context.cwd, pluginConfig.dotenv ?? 'oci.env');
|
|
192
|
-
await release.system.fs.writeFile(file, [
|
|
193
|
-
`oci_version=${version}`,
|
|
194
|
-
`oci_images=${published.map(({ repository, digest }) => `${repository}@${digest}`).join(' ')}`,
|
|
195
|
-
`oci_tags=${[...new Set(published.flatMap(({ tags }) => tags))].join(' ')}`
|
|
196
|
-
].join('\n') + '\n');
|
|
197
|
-
context.logger.log(`Wrote the images published to ${file}.`);
|
|
198
|
-
}
|
|
199
|
-
const [first] = released;
|
|
200
|
-
return {
|
|
201
|
-
name: `OCI images (${published.map(({ repository }) => `${repository}:${version}`).join(', ')})`,
|
|
202
|
-
...(first?.page === undefined ? {} : { url: first.page })
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
export default { verifyConditions, publish };
|
|
271
|
+
});
|
|
272
|
+
export default { verifyConditions, verifyRelease, publish };
|
|
206
273
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAkDA,OAAO,EACL,YAAY,EAGZ,gBAAgB,EACjB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAG/D,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAEjD,OAAO,EAAE,eAAe,EAAsB,MAAM,4BAA4B,CAAA;AAChF,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACpE,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AACzD,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM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as validators of `@wtf/release
|
|
2
|
+
* The schema of the options of the plugin, as validators of `@wtf/release/validator`: each a
|
|
3
3
|
* Standard Schema, and a Standard JSON Schema of the JSON Schema of what it checks.
|
|
4
4
|
*
|
|
5
5
|
* - {@link ociSchema}: the options the plugin is given, of the root of the config, `trains`,
|
|
6
|
-
* `ecosystems
|
|
6
|
+
* `ecosystems` and `train`, and of its entry, as it checks them;
|
|
7
7
|
* - {@link ociOptionsSchema}: the options of its entry, `image`, `sourceRepository`, `sourceTag`,
|
|
8
8
|
* `moving`, `platforms`, `crane` and `dotenv`, its own;
|
|
9
9
|
* - {@link configSchema}: this package's part of a whole config of semantic-release, each entry of
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
* @packageDocumentation
|
|
23
23
|
* @module @wtf/semantic-release-oci/schema
|
|
24
24
|
*/
|
|
25
|
-
import { type JsonSchema, type Validator } from '@wtf/release
|
|
25
|
+
import { type JsonSchema, type Validator } from '@wtf/release/validator';
|
|
26
26
|
import { type RootOptions } from '@wtf/release-trains/schema';
|
|
27
27
|
import type { OciPluginOptions } from './index.ts';
|
|
28
28
|
/** The options of an entry of the plugin, its own: every one of the options but those of the root. */
|
|
29
|
-
export type OciOptions = Omit<OciPluginOptions, 'train' | 'trains' | 'ecosystems'
|
|
29
|
+
export type OciOptions = Omit<OciPluginOptions, 'train' | 'trains' | 'ecosystems'>;
|
|
30
30
|
/** The validator of the options of an entry of the plugin, its own. */
|
|
31
31
|
export declare const ociOptionsSchema: Validator<OciOptions>;
|
|
32
32
|
/**
|
package/dist/schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAKL,KAAK,UAAU,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAKL,KAAK,UAAU,EAIf,KAAK,SAAS,EACf,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAGhF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD,sGAAsG;AACtG,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,gBAAgB,EAAE,OAAO,GAAG,QAAQ,GAAG,YAAY,CAAC,CAAA;AAElF,uEAAuE;AACvE,eAAO,MAAM,gBAAgB,EAAE,SAAS,CAAC,UAAU,CAcjD,CAAA;AAEF;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,SAAS,CAAC,WAAW,GAAG,UAAU,CAGzD,CAAA;AAED,wGAAwG;AACxG,eAAO,MAAM,YAAY,EAAE,SAAS,CAAC,MAAM,CAG1C,CAAA;AAED,2FAA2F;AAC3F,eAAO,MAAM,UAAU,EAAE,UAOxB,CAAA"}
|
package/dist/schema.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The schema of the options of the plugin, as validators of `@wtf/release
|
|
2
|
+
* The schema of the options of the plugin, as validators of `@wtf/release/validator`: each a
|
|
3
3
|
* Standard Schema, and a Standard JSON Schema of the JSON Schema of what it checks.
|
|
4
4
|
*
|
|
5
5
|
* - {@link ociSchema}: the options the plugin is given, of the root of the config, `trains`,
|
|
6
|
-
* `ecosystems
|
|
6
|
+
* `ecosystems` and `train`, and of its entry, as it checks them;
|
|
7
7
|
* - {@link ociOptionsSchema}: the options of its entry, `image`, `sourceRepository`, `sourceTag`,
|
|
8
8
|
* `moving`, `platforms`, `crane` and `dotenv`, its own;
|
|
9
9
|
* - {@link configSchema}: this package's part of a whole config of semantic-release, each entry of
|
|
@@ -22,8 +22,9 @@
|
|
|
22
22
|
* @packageDocumentation
|
|
23
23
|
* @module @wtf/semantic-release-oci/schema
|
|
24
24
|
*/
|
|
25
|
-
import { allOf, anyOf, arrayOf, booleanOf, objectOf, oneOf,
|
|
25
|
+
import { allOf, anyOf, arrayOf, booleanOf, objectOf, oneOf, stringOf } from '@wtf/release/validator';
|
|
26
26
|
import { rootOptionsSchema } from '@wtf/release-trains/schema';
|
|
27
|
+
import { pluginEntriesOf } from '@wtf/semantic-release/schema';
|
|
27
28
|
/** The validator of the options of an entry of the plugin, its own. */
|
|
28
29
|
export const ociOptionsSchema = objectOf({
|
|
29
30
|
image: { of: stringOf({ minLength: 1 }), optional: true },
|
package/dist/schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EACL,KAAK,EACL,KAAK,EACL,OAAO,EACP,SAAS,EAET,QAAQ,EACR,KAAK,EACL,
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EACL,KAAK,EACL,KAAK,EACL,OAAO,EACP,SAAS,EAET,QAAQ,EACR,KAAK,EACL,QAAQ,EAET,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,iBAAiB,EAAoB,MAAM,4BAA4B,CAAA;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAO9D,uEAAuE;AACvE,MAAM,CAAC,MAAM,gBAAgB,GAA0B,QAAQ,CAAa;IAC1E,KAAK,EAAE,EAAE,EAAE,EAAE,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;IACzD,gBAAgB,EAAE,EAAE,EAAE,EAAE,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;IACpE,SAAS,EAAE,EAAE,EAAE,EAAE,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;IAC7D,MAAM,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;IAC3C,SAAS,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;IACtE,KAAK,EAAE,EAAE,EAAE,EAAE,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;IACzD,MAAM,EAAE;QACN,EAAE,EAAE,KAAK,CACP,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,KAAK,CAAU,CAAC,CAAC,EACrD,kBAAkB,CACnB;QACD,QAAQ,EAAE,IAAI;KACf;CACF,CAAC,CAAA;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAwC,KAAK,CACjE,iBAAiB,EACjB,gBAAgB,CACjB,CAAA;AAED,wGAAwG;AACxG,MAAM,CAAC,MAAM,YAAY,GAAsB,eAAe,CAC5D,CAAC,2BAA2B,CAAC,EAC7B,gBAAgB,CACjB,CAAA;AAED,2FAA2F;AAC3F,MAAM,CAAC,MAAM,UAAU,GAAe;IACpC,OAAO,EAAE,8CAA8C;IACvD,GAAG,EAAE,aAAa;IAClB,KAAK,EAAE,2BAA2B;IAClC,WAAW,EACT,8LAA8L;IAChM,GAAG,YAAY,CAAC,UAAU;CAC3B,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wtf/semantic-release-oci",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "The plugin of semantic-release that releases the OCI images of a train of a repo, by @wtf/release-oci, with no rebuild: in publish, the tested image of each, by default the snapshot of the pipeline of the tag, found by its digest and copied by crane to the tags of the release, its version and, of a release, its moving minor and major, a full version the registry has at the same digest skipped and at another refused, so a release that stopped part way is finished by running it again; each image linked to its page in the container registry of GitLab; and the schema of its options and of its part of a config (./schema, schema.json).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"container",
|
|
@@ -53,12 +53,16 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@standard-schema/spec": "^1.1.0",
|
|
56
|
-
"@wtf/
|
|
57
|
-
"@wtf/release
|
|
58
|
-
"@wtf/release-
|
|
56
|
+
"@wtf/platform": "^1.0.0",
|
|
57
|
+
"@wtf/release": "^1.0.0",
|
|
58
|
+
"@wtf/release-oci": "^3.0.0",
|
|
59
|
+
"@wtf/release-trains": "^9.0.0",
|
|
60
|
+
"@wtf/semantic-release": "^1.0.0",
|
|
61
|
+
"semver": "^7.7.0"
|
|
59
62
|
},
|
|
60
63
|
"devDependencies": {
|
|
61
64
|
"@types/node": "^24.10.0",
|
|
65
|
+
"@types/semver": "^7.7.0",
|
|
62
66
|
"semantic-release": "^25.0.9",
|
|
63
67
|
"vitest": "^5.0.5"
|
|
64
68
|
},
|