projen 0.76.5 → 0.76.7

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 (165) hide show
  1. package/.jsii +46 -46
  2. package/README.md +38 -33
  3. package/lib/awscdk/auto-discover.js +5 -5
  4. package/lib/awscdk/awscdk-app-java.js +1 -1
  5. package/lib/awscdk/awscdk-app-py.js +1 -1
  6. package/lib/awscdk/awscdk-app-ts.js +1 -1
  7. package/lib/awscdk/awscdk-construct.js +2 -2
  8. package/lib/awscdk/awscdk-deps-java.js +1 -1
  9. package/lib/awscdk/awscdk-deps-js.js +1 -1
  10. package/lib/awscdk/awscdk-deps-py.js +1 -1
  11. package/lib/awscdk/awscdk-deps.js +1 -1
  12. package/lib/awscdk/cdk-config.js +1 -1
  13. package/lib/awscdk/cdk-tasks.js +1 -1
  14. package/lib/awscdk/integration-test.js +1 -1
  15. package/lib/awscdk/lambda-extension.js +1 -1
  16. package/lib/awscdk/lambda-function.js +2 -2
  17. package/lib/build/build-workflow.js +1 -1
  18. package/lib/cdk/auto-discover-base.js +2 -2
  19. package/lib/cdk/construct-lib.js +1 -1
  20. package/lib/cdk/integration-test-base.js +1 -1
  21. package/lib/cdk/jsii-docgen.js +1 -1
  22. package/lib/cdk/jsii-project.js +1 -1
  23. package/lib/cdk8s/auto-discover.js +2 -2
  24. package/lib/cdk8s/cdk8s-app-py.js +1 -1
  25. package/lib/cdk8s/cdk8s-app-ts.js +1 -1
  26. package/lib/cdk8s/cdk8s-construct.js +1 -1
  27. package/lib/cdk8s/cdk8s-deps-py.js +1 -1
  28. package/lib/cdk8s/cdk8s-deps.js +1 -1
  29. package/lib/cdk8s/integration-test.js +1 -1
  30. package/lib/cdktf/cdktf-construct.js +1 -1
  31. package/lib/circleci/circleci.js +1 -1
  32. package/lib/component.js +1 -1
  33. package/lib/dependencies.js +1 -1
  34. package/lib/dev-env.js +1 -1
  35. package/lib/docker-compose/docker-compose-service.js +1 -1
  36. package/lib/docker-compose/docker-compose.js +1 -1
  37. package/lib/file.js +3 -3
  38. package/lib/gitattributes.js +1 -1
  39. package/lib/github/actions-provider.js +1 -1
  40. package/lib/github/auto-approve.js +1 -1
  41. package/lib/github/auto-merge.js +1 -1
  42. package/lib/github/dependabot.js +1 -1
  43. package/lib/github/github-credentials.js +1 -1
  44. package/lib/github/github-project.js +1 -1
  45. package/lib/github/github.js +1 -1
  46. package/lib/github/mergify.js +1 -1
  47. package/lib/github/pr-template.js +1 -1
  48. package/lib/github/pull-request-lint.js +1 -1
  49. package/lib/github/stale.js +1 -1
  50. package/lib/github/task-workflow.js +1 -1
  51. package/lib/github/workflow-actions.js +1 -1
  52. package/lib/github/workflow-jobs.js +1 -1
  53. package/lib/github/workflows.js +1 -1
  54. package/lib/gitlab/configuration.js +1 -1
  55. package/lib/gitlab/gitlab-configuration.js +1 -1
  56. package/lib/gitlab/nested-configuration.js +1 -1
  57. package/lib/gitpod.js +1 -1
  58. package/lib/ignore-file.js +1 -1
  59. package/lib/ini.js +1 -1
  60. package/lib/java/java-project.js +1 -1
  61. package/lib/java/junit.js +1 -1
  62. package/lib/java/maven-compile.js +1 -1
  63. package/lib/java/maven-packaging.js +1 -1
  64. package/lib/java/maven-sample.js +1 -1
  65. package/lib/java/pom.js +1 -1
  66. package/lib/java/projenrc.js +1 -1
  67. package/lib/javascript/bundler.js +1 -1
  68. package/lib/javascript/eslint.js +1 -1
  69. package/lib/javascript/jest.js +4 -4
  70. package/lib/javascript/node-package.js +1 -1
  71. package/lib/javascript/node-project.d.ts +2 -1
  72. package/lib/javascript/node-project.js +11 -6
  73. package/lib/javascript/npm-config.js +1 -1
  74. package/lib/javascript/prettier.js +1 -1
  75. package/lib/javascript/projenrc.js +1 -1
  76. package/lib/javascript/typescript-config.js +2 -2
  77. package/lib/javascript/upgrade-dependencies.d.ts +1 -1
  78. package/lib/javascript/upgrade-dependencies.js +3 -3
  79. package/lib/json-patch.js +1 -1
  80. package/lib/json.js +1 -1
  81. package/lib/license.js +1 -1
  82. package/lib/logger.js +1 -1
  83. package/lib/makefile.js +1 -1
  84. package/lib/object-file.js +1 -1
  85. package/lib/project-build.js +1 -1
  86. package/lib/project.d.ts +4 -4
  87. package/lib/project.js +6 -6
  88. package/lib/projects.js +1 -1
  89. package/lib/projenrc-json.js +2 -2
  90. package/lib/projenrc.js +1 -1
  91. package/lib/python/pip.js +1 -1
  92. package/lib/python/poetry.js +2 -2
  93. package/lib/python/projenrc.js +1 -1
  94. package/lib/python/pytest-sample.js +1 -1
  95. package/lib/python/pytest.js +1 -1
  96. package/lib/python/python-project.js +1 -1
  97. package/lib/python/python-sample.js +1 -1
  98. package/lib/python/requirements-file.js +1 -1
  99. package/lib/python/setuppy.js +1 -1
  100. package/lib/python/setuptools.js +1 -1
  101. package/lib/python/venv.js +1 -1
  102. package/lib/readme.js +1 -1
  103. package/lib/release/publisher.js +1 -1
  104. package/lib/release/release-trigger.js +1 -1
  105. package/lib/release/release.js +1 -1
  106. package/lib/renovatebot.js +1 -1
  107. package/lib/sample-file.js +2 -2
  108. package/lib/semver.js +1 -1
  109. package/lib/source-code.js +1 -1
  110. package/lib/task-runtime.js +1 -1
  111. package/lib/task.js +1 -1
  112. package/lib/tasks.js +1 -1
  113. package/lib/testing.js +1 -1
  114. package/lib/textfile.js +1 -1
  115. package/lib/toml.js +1 -1
  116. package/lib/typescript/projenrc-ts.js +1 -1
  117. package/lib/typescript/projenrc.js +1 -1
  118. package/lib/typescript/typescript-typedoc.js +1 -1
  119. package/lib/typescript/typescript.js +3 -3
  120. package/lib/util.d.ts +1 -0
  121. package/lib/util.js +2 -1
  122. package/lib/version.js +2 -2
  123. package/lib/vscode/devcontainer.js +1 -1
  124. package/lib/vscode/extensions.js +1 -1
  125. package/lib/vscode/launch-config.js +1 -1
  126. package/lib/vscode/settings.js +1 -1
  127. package/lib/vscode/vscode.js +1 -1
  128. package/lib/web/next.js +3 -3
  129. package/lib/web/postcss.js +1 -1
  130. package/lib/web/react.js +4 -4
  131. package/lib/web/tailwind.js +1 -1
  132. package/lib/xmlfile.js +1 -1
  133. package/lib/yaml.js +1 -1
  134. package/package.json +1 -1
  135. package/.prettierignore +0 -1
  136. package/.prettierrc.json +0 -3
  137. package/docs/CNAME +0 -1
  138. package/docs/README.md +0 -28
  139. package/docs/api/API.md +0 -21296
  140. package/docs/awscdk-apps.md +0 -18
  141. package/docs/awscdk-construct.md +0 -195
  142. package/docs/awscdk.md +0 -377
  143. package/docs/build.md +0 -55
  144. package/docs/bundling.md +0 -30
  145. package/docs/cdk8s.md +0 -39
  146. package/docs/circleci.md +0 -87
  147. package/docs/components.md +0 -21
  148. package/docs/deps.md +0 -62
  149. package/docs/eject.md +0 -30
  150. package/docs/escape-hatches.md +0 -113
  151. package/docs/github.md +0 -155
  152. package/docs/gitlab.md +0 -67
  153. package/docs/java.md +0 -213
  154. package/docs/node.md +0 -150
  155. package/docs/programmatic-api.md +0 -56
  156. package/docs/publisher.md +0 -148
  157. package/docs/python.md +0 -169
  158. package/docs/releases.md +0 -191
  159. package/docs/subproject.md +0 -37
  160. package/docs/tasks.md +0 -211
  161. package/docs/typescript.md +0 -119
  162. package/logo/projen.svg +0 -211
  163. package/rfcs/github-project-settings.md +0 -95
  164. package/rfcs/project-creation-prompt.md +0 -95
  165. package/version.json +0 -3
package/docs/java.md DELETED
@@ -1,213 +0,0 @@
1
- # Java Projects
2
-
3
- To create a new Java project, use `projen new java`:
4
-
5
- ```shell
6
- $ projen new java --group-id org.acme --artifact-id hello-maven
7
- ```
8
-
9
- This will synthesize a standard Maven project directory structure with a
10
- `pom.xml` file and some sample code:
11
-
12
- ```shell
13
- ├── pom.xml
14
- └── src
15
- ├── main/java/org/acme
16
- │   └── Main.java
17
- └── test/java/org/acme
18
- └── MyTest.java
19
- ```
20
-
21
- At this point, you should be able to now simply run `projen build` to build your
22
- project:
23
-
24
- ```shell
25
- $ projen build
26
- [INFO] BUILD SUCCESS
27
- ```
28
-
29
- > Since this is a standard Maven project, so you can also use `mvn package`,
30
- > `mvn test`, etc. IDEs should also feel at home with this project.
31
-
32
- The `projen new` command will also generate a `.projenrc.js` file which includes
33
- the definition of your project with any options you specified in the command
34
- line:
35
-
36
- ```js
37
- const { java } = require('projen');
38
-
39
- const project = new java.JavaProject({
40
- artifactId: 'hello-maven',
41
- groupId: 'org.acme',
42
- name: 'hello-maven',
43
- version: '0.1.0',
44
- });
45
-
46
- project.synth();
47
- ```
48
-
49
- It is possible to create your projenrc file in java. In the future, this will be
50
- the default, but at the moment you need to add some configuration. See the
51
- [`projenrc.java`](#projenrcjava) section for details.
52
-
53
- To modify your project definitions, edit `.projenrc.js` and run `projen` again
54
- to re-synthesize your project. The following sections describe the various features of Java projects.
55
-
56
- ## Versioning
57
-
58
- You can set the project version through the `version` options:
59
-
60
- ```ts
61
- const project = new java.MavenProject({
62
- version: '1.2.3'
63
- };
64
- ```
65
-
66
- ## Project Metadata
67
-
68
- You can specify additional metadata for your project by passing options to the
69
- constructor of `MavenProject`. For example, let's add a description and a URL
70
- for your project:
71
-
72
- ```ts
73
- const project = new java.JavaProject({
74
- // ...
75
-
76
- description: 'My first java projen project',
77
- url: 'https://github.com/projen/projen'
78
- });
79
- ```
80
-
81
- See the API reference for [PomOptions](api/API.md#projen-java-pomoptions) for a
82
- detailed list of options.
83
-
84
- ## Dependencies
85
-
86
- Java projects have three types of supported dependencies:
87
-
88
- 1. Runtime dependencies (or just "dependencies").
89
- 2. Test dependencies
90
- 3. Maven plugins (modeled as build dependencies).
91
-
92
- You can define dependencies when defining the project itself:
93
-
94
- ```ts
95
- const project = new JavaProject({
96
- deps: [
97
- 'software.amazon.awscdk/core@^1.2.3',
98
- 'software.amazon.awscdk/aws-s3@^1',
99
- ]
100
- });
101
- ```
102
-
103
- Or using the APIs:
104
-
105
- ```ts
106
- project.addTestDependency('org.assertj/assertj-core@^3');
107
- ```
108
-
109
- Notice the syntax for dependencies:
110
-
111
- ```text
112
- <groupId>/<artifactId>[@version]
113
- ```
114
-
115
- Where `groupID` and `artifactId` are the Maven coordinates and `version` is the
116
- [semantic version requirement](https://semver.org) for the dependency. The
117
- semver syntax will be converted to POM syntax. For example, `^3.1.0` will be
118
- converted to `[3.1.0,4.0.0)`.
119
-
120
- ## `projenrc.java`
121
-
122
- It is possible to write your projenrc file in Java. In the future this will be
123
- the default for Java projects, but at the moment this needs to be enabled when
124
- the project is created:
125
-
126
- ```shell
127
- $ projen new java --projenrc-java
128
- ```
129
-
130
- Or set through:
131
-
132
- ```ts
133
- new java.JavaProject({
134
- // ...
135
- projenrcJava: true
136
- });
137
- ```
138
-
139
- Then, create a file `src/test/java/projenrc.java` that looks like this:
140
-
141
- ```java
142
- import org.projen.java.JavaProject;
143
- import org.projen.java.JavaProjectOptions;
144
-
145
- public class projenrc {
146
- public static void main(String[] args) {
147
- JavaProject project = new JavaProject(JavaProjectOptions.builder()
148
- .name("my-app")
149
- .groupId("org.acme")
150
- .artifactId("my-app")
151
- .version("1.0.0")
152
- .build());
153
-
154
- project.synth();
155
- }
156
- }
157
- ```
158
-
159
- In order to synthesize, run: `pj synth`, which will compile your test code and
160
- execute this program.
161
-
162
- By default, `projenrc.java` is placed under the `test` scope (and
163
- `io.github.cdklabs/projen` test dependency is added). This ensures that
164
- application code does not take a dependency on projen code. You can change this
165
- behavior by setting the `testScope` option to `false`.
166
-
167
- ## Maven Plugins
168
-
169
- You can add Maven build plugins to your project using `project.addPlugin()`:
170
-
171
- ```ts
172
- project.addPlugin('org.apache.maven.plugins/maven-compiler-plugin@3.8.1', {
173
- configuration: {
174
- source: '1.8',
175
- target: '1.8',
176
- },
177
- });
178
- ```
179
-
180
- ## Unit Testing with JUnit
181
-
182
- The `JUnit` component adds support for writing Java tests with
183
- [JUnit](https://junit.org/). The component will add the required test
184
- dependencies to your POM file.
185
-
186
- Test sources are placed under `src/test` and can be executed via `mvn test` or
187
- `projen test` (same).
188
-
189
- To disable JUnit tests, set `junit: false` when you define the `MavenProject`.
190
-
191
- ## Packaging
192
-
193
- Java projects include definitionds for producing an output that is
194
- ready-to-publish to Maven using tools like
195
- [jsii-release](https://www.npmjs.com/package/jsii-release). In future versions
196
- of projen we will also support auto-publishing through CI/CD.
197
-
198
- The packaging component adds a `package` task which uses `mvn deploy` to create
199
- a local maven directory with artifacts that can be uploaded to a Maven
200
- repository such as Maven Central, CodeArtifact or GitHub Packages.
201
-
202
- By default, packages includes *javadocs* and *sources*. Those can be disabled
203
- through `packagingOptions`.
204
-
205
- ## Publishing
206
-
207
- TBD.
208
-
209
- > Publishing to Maven is still not supported output of the box. Since the
210
- > package output of `JavaProject` is compatible with
211
- > [jsii-release](https://www.npmjs.com/package/jsii-release), and we already
212
- > release to Maven from jsii projects, it should be possible to reuse quite a
213
- > lot.
package/docs/node.md DELETED
@@ -1,150 +0,0 @@
1
- # Node.js Projects
2
-
3
- This topic describes all the features of `NodeProject` projects and their
4
- derivatives.
5
-
6
- ## Node versioning
7
-
8
- You can specify the minimum version of node that your project supports, and the version of node used in GitHub workflows:
9
-
10
- ```js
11
- const project = new javascript.NodeProject({
12
- // ...
13
- minNodeVersion: '16.0.0',
14
- workflowNodeVersion: '16.1.0', // defaults to minNodeVersion
15
- });
16
- ```
17
-
18
- ## Development Workflow
19
-
20
- TODO
21
-
22
- ## GitHub workflows
23
-
24
- Node.js projects with GitHub enabled come bundled with components for running
25
- build workflows on every pull request, automatically upgrading dependencies, and
26
- other conveniences.
27
-
28
- For more general information about managing GitHub configuration, check out
29
- [GitHub](./github.md).
30
-
31
- ## Dependencies
32
-
33
- See [Dependencies](#dependencies) for general information about how dependencies
34
- are managed by projen, and how to add new dependencies to your project. By
35
- default, every Node.js project includes a `Dependencies` component which will
36
- manage the dependencies in `package.json`.
37
-
38
- When a dependency is managed by projen, it gets added to `package.json` and will
39
- automatically installed after running `npx projen`. Packages will be installed
40
- according to the package manager being used. This can be configured:
41
-
42
- ```ts
43
- const project = new javascript.NodeProject({
44
- // ...
45
- packageManager: javascript.NodePackageManager.YARN_CLASSIC, // or NPM, PNPM, etc.
46
- });
47
- ```
48
-
49
- Any dependencies without specific version ranges set (such as `react` or
50
- `react@*`) will given a version range in `package.json` so that future package
51
- upgrades and changes to the generated lockfiles such as `package-lock.json` or
52
- `yarn.lock` will follow semver.
53
-
54
- A list of all dependencies managed by projen is also reported in
55
- `.projen/deps.json`.
56
-
57
- ### Dependency upgrades
58
-
59
- Node.js projects include an `upgrade` [task] and `upgrade.yml` [GitHub workflow]
60
- that updates node dependencies following semver. The GitHub workflow will
61
- automatically run once a day, and can also be automatically approved for
62
- hands-off dependency managed.
63
-
64
- > If you want to upgrade a dependency to a new **major** version (with possible
65
- > breaking changes), you should update its version range via the projenrc file.
66
-
67
- In order to create these PRs, permissions to GitHub APIs are needed beyond those
68
- provided by GITHUB_TOKEN, otherwise no subsequent workflows will be triggered,
69
- such as the build workflow (see [create-pull-request#48] for details). Because
70
- of this we require, [GitHub API access] to be provided for these workflows.
71
-
72
- It's possible to create a separate workflow and task just for upgrading projen:
73
-
74
- ```ts
75
- const project = new javascript.NodeProject({
76
- depsUpgrade: true,
77
- depsUpgradeOptions: {
78
- exclude: ['projen'],
79
- },
80
- });
81
-
82
- new javascript.UpgradeDependencies(project, {
83
- include: ['projen'],
84
- taskName: "upgrade-projen",
85
- workflow: false, // or true
86
- // workflowOptions: { ... }
87
- });
88
- ```
89
-
90
- You can also use dependabot or renovatebot to get Pull requests on dependency updates
91
-
92
- * Dependabot:
93
- ```ts
94
- new javascript.NodeProject({
95
- depsUpgrade: false,
96
- dependabot: true,
97
- // dependabotOptions: { ... }
98
- })
99
- ```
100
- * Renovatebot:
101
- ```ts
102
- new javascript.NodeProject({
103
- depsUpgrade: false,
104
- renovatebot: true,
105
- // renovatebotOptions: { ... }
106
- })
107
- ```
108
-
109
- [task]: ./tasks.md
110
- [GitHub workflow]: ./github.md#workflows
111
- [create-pull-request#48]: https://github.com/peter-evans/create-pull-request/issues/48
112
- [GitHub API access]: ./github.md#github-api-access
113
-
114
- ## Pull Request Builds (CI)
115
-
116
- TODO
117
-
118
- ## Releases (CI/CD)
119
-
120
- TODO
121
-
122
- ## Features
123
-
124
- ### Scoped Private Packages
125
-
126
- Scoped private packages can be configured in this project and its ancestors.
127
-
128
- All npm packages have a name. Some package names also have a scope. A scope follows the usual rules for package names (URL-safe characters, no leading dots or underscores). When used in package names, scopes are preceded by an @ symbol and followed by a slash, e.g. `@somescope/somepackagename`
129
-
130
- This feature supports specifying options on how package managers should access packages in each of the scopes. If no options are specified, npm or yarn will try to install scoped packages from the public npm registry.
131
-
132
- Currently, it only supports fetching packages from AWS CodeArtifact, either by directly access via credentials or by assuming a role using the specified credentials. Credentials must be provided in the CodeArtifactOptions property.
133
-
134
- Multiple scoped package options may be specified if required.
135
-
136
- example
137
- ```js
138
- const { javascript } = require('projen');
139
- const project = new javascript.NodeProject({
140
- defaultReleaseBranch: 'main',
141
- name: 'my-project',
142
- scopedPackagesOptions: [
143
- {
144
- registryUrl: '<code-artifact-registry-url>',
145
- scope: '@somescope',
146
- }
147
- ]
148
- });
149
- project.synth();
150
- ```
@@ -1,56 +0,0 @@
1
- # Programmatic API
2
-
3
- Projen exposes a programmatic API that allows you to create new projects through
4
- code instead of the regular CLI command `npx projen new`. This allows projen to
5
- be used to create new projects within scripts and other contexts.
6
-
7
- ## Example
8
-
9
- ```js
10
- const { Projects } = require('projen');
11
-
12
- Projects.createProject({
13
- dir: '/path/to/mydir',
14
- projectFqn: 'projen.typescript.TypeScriptProject',
15
- projectOptions: {
16
- name: 'my-test-project',
17
- defaultReleaseBranch: 'main',
18
- projenrcTs: true,
19
- eslintOptions: {
20
- dirs: ['src', 'test'],
21
- prettier: true,
22
- aliasMap: {
23
- '@src': './src',
24
- '@components': './src/components',
25
- },
26
- },
27
- },
28
- post: false,
29
- // synth: true (default)
30
- // optionHints: 'featured' (default)
31
- });
32
- ```
33
-
34
- This script creates a new TypeScript project at `/path/to/mydir` in my file
35
- system. The `.projenrc.ts` file it generates comes pre-included with options
36
- specified, including complex values for fields that cannot normally be provided
37
- through the CLI, like `eslintOptions` (because the field requires an object
38
- value).
39
-
40
- In the above example, the provided option `post: false` was also added to
41
- disable post-installation steps such as installing NPM dependencies.
42
-
43
- > **Note:** It is important that you provide all fields that are required by the
44
- project type, otherwise the project may not synthesize properly.
45
-
46
- It is also possible to use this for installing external project types.
47
- Currently, this requires you to install the package so that it can be used by
48
- projen.
49
-
50
- ```js
51
- Projects.createProject({
52
- // ...
53
- projectFqn: '@myorg/my-package.MyJsiiProject',
54
- });
55
- ```
56
-
package/docs/publisher.md DELETED
@@ -1,148 +0,0 @@
1
- # Publishing Modules
2
-
3
- The `Publisher` component supports publishing modules to various package
4
- managers. It is designed to be attached to a GitHub workflow that takes care of
5
- building the module and uploading a "ready to publish" artifact.
6
-
7
- > This component is utilized in `NodeProject` and `JsiiProject` to publish modules.
8
-
9
- Supported package managers:
10
-
11
- - npm
12
- - Maven
13
- - PyPI
14
- - NuGet
15
- - Go (GitHub)
16
-
17
- This is how a publisher is initialized:
18
-
19
- ```ts
20
- const publisher = new Publisher(project, {
21
- workflow: releaseWorkflow,
22
- buildJobId: 'my-build-job',
23
- artifactName: 'dist',
24
- });
25
- ```
26
-
27
- `workflow` is a `GithubWorkflow` with at least one job (in this case named
28
- `my-build-job`) which is responsible to build the code and upload a GitHub
29
- workflows artifact (named `dist` in this case) which will then be consumed by
30
- the publishing jobs.
31
-
32
- This component is opinionated about the subdirectory structure of the artifact:
33
-
34
- |Subdirectory|Type|Contents|
35
- |-|-|-|
36
- |`js/*.tgz`|NPM|npm tarballs
37
- |`dotnet/*.nupkg`|NuGet|Nuget packages
38
- |`python/*.whl`|PyPI|Python wheels
39
- |`go/**/go.mod`|Go|Go modules. Each subdirectory should have its own `go.mod` file
40
- |`java/**`|Maven|Maven artifacts in local repository structure
41
-
42
- Then, you should call `publishToXxx` to add publishing jobs to the workflow:
43
-
44
- For example:
45
-
46
- ```ts
47
- publisher.publishToNuGet();
48
- publisher.publishToMaven(/* options */);
49
- // ...
50
- ```
51
-
52
- See API reference for options for each target.
53
-
54
- ## Customizing Publishing Jobs
55
-
56
- You can customize the publishing jobs by specifying `prePublishSteps` which is a
57
- set of GitHub workflow steps to be executed before publishing. The
58
- `publishTools` option can be used to setup the toolchain required for the
59
- publishing job.
60
-
61
- For example:
62
-
63
- ```ts
64
- publisher.publishToNuGet({
65
- publishTools: { dotnet: { version: '5.x' } },
66
- prePublishSteps: [
67
- { run: 'dotnet ...' }
68
- ]
69
- });
70
- ```
71
-
72
- ## Publishing to GitHub Packages
73
-
74
- Some targets come with dynamic defaults that support GitHub Packages.
75
- If the respective registry URL is detected to be GitHub, other relevant options will automatically be set to fitting values.
76
- It will also ensure that the workflow token has write permissions for Packages.
77
-
78
- **npm**
79
-
80
- ```ts
81
- publisher.publishToNpm({
82
- registry: 'npm.pkg.github.com'
83
- // also sets npmTokenSecret
84
- })
85
- ```
86
-
87
- **Maven**
88
-
89
- ```ts
90
- publisher.publishToMaven({
91
- mavenRepositoryUrl: 'https://maven.pkg.github.com/USER/REPO'
92
- // also sets mavenServerId, mavenUsername, mavenPassword
93
- // disables mavenGpgPrivateKeySecret, mavenGpgPrivateKeyPassphrase, mavenStagingProfileId
94
- })
95
- ```
96
-
97
- ## Publishing to AWS CodeArtifact
98
-
99
- The NPM target comes with dynamic defaults that support AWS CodeArtifact.
100
- If the respective registry URL is detected to be AWS CodeArtifact, other relevant options will automatically be set to fitting values.
101
- The authentication will done using [AWS CLI](https://docs.aws.amazon.com/codeartifact/latest/ug/tokens-authentication.html). It is neccessary to provide AWS IAM CLI `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` in GitHub Secrets.
102
-
103
- **npm**
104
-
105
- ```ts
106
- publisher.publishToNpm({
107
- registry: 'my-domain-111122223333.d.codeartifact.us-west-2.amazonaws.com/npm/my_repo/',
108
- });
109
- ```
110
-
111
- The names of the GitHub Secrets can be overridden if different names should be used.
112
-
113
- ```ts
114
- publisher.publishToNpm({
115
- registry: 'my-domain-111122223333.d.codeartifact.us-west-2.amazonaws.com/npm/my_repo/',
116
- codeArtifactOptions: {
117
- accessKeyIdSecret: 'CUSTOM_AWS_ACCESS_KEY_ID',
118
- secretAccessKeySecret: 'CUSTOM_AWS_SECRET_ACCESS_KEY',
119
- },
120
- });
121
- ```
122
-
123
- ## Handling Failures
124
-
125
- You can instruct the publisher to create GitHub issues for publish failures:
126
-
127
- ```ts
128
- const publisher = new Publisher(project, {
129
- workflow: releaseWorkflow,
130
- buildJobId: 'my-build-job',
131
- artifactName: 'dist',
132
- issueOnFailure: true,
133
- failureIssueLabel: 'failed-release'
134
- });
135
- ```
136
-
137
- This will create an issue labeled with the `failed-release` label for every individual failed publish task.
138
- For example, if Nuget publishing failed for a specific version, it will create an issue titled *Publishing v1.0.4 to Nuget gallery failed*.
139
-
140
- This can be helpful to keep track of failed releases as well as integrate with third-party ticketing systems by querying issues labeled with `failed-release`.
141
-
142
- ## Dry run
143
-
144
- If you wish to completely disable publishing, you can enable the `dryRun` option on
145
- `Publisher` or `publishDryRun` on the project.
146
-
147
- This will cause all publishing tasks and jobs to just print the publishing
148
- command but not actually publish.