@arc-e-tect/api-only-publisher 0.17.0 → 0.18.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.adoc +13 -5
- package/package.json +1 -1
package/README.adoc
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
:source-highlighter: rouge
|
|
7
7
|
// The released version of this component: its snippets use it. The release
|
|
8
8
|
// workflow updates it; do not change it by hand.
|
|
9
|
-
:api-only-publisher-version: 0.
|
|
9
|
+
:api-only-publisher-version: 0.18.0
|
|
10
10
|
|
|
11
11
|
[NOTE]
|
|
12
12
|
.About this documentation
|
|
@@ -2110,8 +2110,9 @@ package:
|
|
|
2110
2110
|
[#docker-github-actions]
|
|
2111
2111
|
==== Reference pipeline: GitHub Actions
|
|
2112
2112
|
|
|
2113
|
-
Two jobs: `package` runs the image and hands the files on, `publish` checks them against the hand-off
|
|
2114
|
-
|
|
2113
|
+
Two jobs on a tag: `package` runs the image and hands the files on, `publish` checks them against the hand-off, publishes them to npm, Maven and NuGet on GitHub Packages, and to a GitHub Release, with the job's `GITHUB_TOKEN`, and tags each target's release, `<target>-v<version>`.
|
|
2114
|
+
On a pull request, a third job, `check`, runs the image's `check` with no network, against the merge-base with the pull request's base branch (<<version-guard,A changed target needs a new version §>>).
|
|
2115
|
+
Copy it into `.github/workflows/`, then set the digest, the targets and the trigger, and `TAG_FORMAT` if `versioning.tagFormat` names the tags otherwise.
|
|
2115
2116
|
The container-job variant above replaces its `package` job.
|
|
2116
2117
|
|
|
2117
2118
|
It is exercised end to end, both variants, by a workflow in this repository that publishes to scratch packages and resolves each one with its ecosystem's own client and with the API-Only Subscriber.
|
|
@@ -2123,8 +2124,11 @@ include::pipelines/github-actions.yml[]
|
|
|
2123
2124
|
|
|
2124
2125
|
What the two steps lose, and how the pipeline makes up for it:
|
|
2125
2126
|
|
|
2126
|
-
* *Idempotence.* A channel's remote mode leaves a version the registry has alone when it holds the same documents, and
|
|
2127
|
-
Each publishing step checks for the version first, compares the bytes, and publishes only what is missing, so a re-run is safe
|
|
2127
|
+
* *Idempotence.* A channel's remote mode leaves a version the registry has alone when it holds the same documents, and does not replace it when it holds others; `npm publish` or `dotnet nuget push` of an existing version fails instead.
|
|
2128
|
+
Each publishing step checks for the version first, compares the documents its `manifest.json` lists -- not the bytes, which differ by commit -- and publishes only what is missing, so a re-run is safe.
|
|
2129
|
+
A version held with other documents, or a registry that cannot be reached, is a `::warning` on the run, never a failed job, as for the Publisher's own channels (<<channel-problems,When a channel cannot take a version §>>).
|
|
2130
|
+
* *History.* Every job that runs the Publisher checks out the full history and the tags, `fetch-depth: 0`, which `check` and `publish` compare each target's version against.
|
|
2131
|
+
* *Release tags.* The last step creates each target's release tag at the commit it published, unless it exists; a tag it cannot create is a warning.
|
|
2128
2132
|
* *Maven checksums and metadata.* The local Maven layout holds the artifact, its POM and its manifest, and no `.md5`, `.sha1` or `maven-metadata.xml`.
|
|
2129
2133
|
`mvn deploy:deploy-file` writes those when it uploads, so the repository ends up as a remote `maven` channel would leave it, and Gradle resolves it.
|
|
2130
2134
|
|
|
@@ -2132,6 +2136,8 @@ Each publishing step checks for the version first, compares the bytes, and publi
|
|
|
2132
2136
|
==== Reference pipeline: GitLab CI
|
|
2133
2137
|
|
|
2134
2138
|
One job, on a `v*` tag, as the GitHub Actions pipeline: the image builds, lints and publishes the targets to the project's Generic Package Registry with `gitlab-package`, and, where `apionly.yaml` configures it, to the project's Maven registry, both with the job's `CI_JOB_TOKEN`.
|
|
2139
|
+
In a merge request, a `check` job runs the image's `check` against the merge-base with the target branch; both jobs fetch the full history, `GIT_DEPTH: 0`, and the branch they compare with.
|
|
2140
|
+
`gitlab-package` with `release: true` creates each target's release, and with it the tag `<target>-v<version>` that `check` reads; without it, nothing creates that tag, and `check` compares with the merge-base alone.
|
|
2135
2141
|
`apionly.yaml` needs no GitLab settings for it; the pipeline's header says what to add for the Maven registry.
|
|
2136
2142
|
Copy it to `.gitlab-ci.yml`, then set the digest and the targets.
|
|
2137
2143
|
The tag pattern keeps out the tag a GitLab release puts on the commit, `<target>-v<version>`, which would otherwise start the pipeline a second time; a library that tags its releases otherwise changes the rule, and keeps that one out.
|
|
@@ -2147,6 +2153,8 @@ include::pipelines/gitlab-ci.yml[]
|
|
|
2147
2153
|
link:../docs/guides/publishing-to-gitlab/overview.adoc[Publishing to GitLab →] is the guide: tokens, a self-managed GitLab, and what consumers need.
|
|
2148
2154
|
|
|
2149
2155
|
*The two-step variant*, link:pipelines/gitlab-ci-two-step.yml[`pipelines/gitlab-ci-two-step.yml` →], keeps the image sealed: `package` runs in the image, and one `publish:*` job per registry publishes to the project's package registry with that registry's own client and `CI_JOB_TOKEN`: npm, Maven and NuGet, and the archives to the generic package registry.
|
|
2156
|
+
As in the GitHub Actions pipeline, each compares documents and warns rather than fails, a merge request runs `check`, and a last job, `release:tags`, creates a GitLab release, and with it the tag, for each target's release; a pre-release gets none, as GitLab would make it the latest release.
|
|
2157
|
+
It runs on a `v*` tag, so the tags it creates do not start it again.
|
|
2150
2158
|
It is validated against GitLab's published CI schema only; no GitLab pipeline has run it yet.
|
|
2151
2159
|
|
|
2152
2160
|
[#docker-mirror-in-pipelines]
|
package/package.json
CHANGED