@halospv3/hce.shared-config 2.6.4 → 3.0.0-develop.2

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 (152) hide show
  1. package/CHANGELOG.md +356 -101
  2. package/README.md +100 -87
  3. package/dotnet/.github/workflows/_unit_test.yml +6 -3
  4. package/dotnet/.github/workflows/ci.yml +2 -2
  5. package/dotnet/.github/workflows/dotnet-release.yml +31 -28
  6. package/dotnet/.github/workflows/sample-dotnet-build.yml +16 -11
  7. package/dotnet/ExecNupkgDeterministicator.README.md +20 -0
  8. package/dotnet/ExecNupkgDeterministicator.targets +173 -0
  9. package/dotnet/GitVersion.yml +3 -1
  10. package/dotnet/GitVersion6.0.yml +3 -1
  11. package/dotnet/HCE.Shared.sln +34 -0
  12. package/dotnet/HCE.Shared.targets +1 -0
  13. package/dotnet/PublishAll.targets +2 -0
  14. package/dotnet/SignAfterPack.targets +104 -0
  15. package/dotnet/samples/HCE.Shared.DeterministicNupkg/Dummy.cs +6 -0
  16. package/dotnet/samples/HCE.Shared.DeterministicNupkg/HCE.Shared.DeterministicNupkg.csproj +21 -0
  17. package/dotnet/samples/HCE.Shared.SignAfterPack/Class1.cs +6 -0
  18. package/dotnet/samples/HCE.Shared.SignAfterPack/HCE.Shared.SignAfterPack.csproj +21 -0
  19. package/dotnet/samples/HCE.Shared.SignAfterPack/sampleCert.samplepfx +0 -0
  20. package/dotnet/samples/README.md +7 -0
  21. package/package.json +72 -73
  22. package/src/CaseInsensitiveMap.ts +34 -0
  23. package/src/commitlintConfig.ts +17 -9
  24. package/src/debug.ts +3 -3
  25. package/src/dotnet/GithubNugetRegistryInfo.ts +60 -0
  26. package/src/dotnet/GitlabNugetRegistryInfo.ts +112 -0
  27. package/src/dotnet/IsNextVersionAlreadyPublished.cli.ts +44 -0
  28. package/src/dotnet/MSBuildProject.ts +557 -76
  29. package/src/dotnet/MSBuildProjectProperties.ts +280 -15
  30. package/src/dotnet/NugetProjectProperties.ts +608 -0
  31. package/src/dotnet/NugetRegistryInfo.ts +939 -0
  32. package/src/dotnet/helpers.ts +448 -0
  33. package/src/eslintConfig.ts +174 -71
  34. package/src/index.ts +1 -3
  35. package/src/semantic-release__commit-analyzer.d.ts +44 -38
  36. package/src/semantic-release__exec.d.ts +15 -0
  37. package/src/semantic-release__git.d.ts +85 -88
  38. package/src/semantic-release__github.d.ts +139 -139
  39. package/src/semanticReleaseConfig.ts +106 -47
  40. package/src/semanticReleaseConfigDotnet.ts +394 -104
  41. package/src/setupGitPluginSpec.ts +149 -57
  42. package/src/tsconfig.json +8 -8
  43. package/src/utils/Exact.ts +49 -0
  44. package/src/utils/GracefulRecursion.d.ts +12 -0
  45. package/src/utils/env.ts +44 -0
  46. package/src/utils/execAsync.ts +77 -0
  47. package/src/utils/miscTypes.ts +17 -0
  48. package/src/utils/reflection/FunctionLike.d.ts +17 -0
  49. package/src/utils/reflection/GetterDescriptor.d.ts +8 -0
  50. package/src/utils/reflection/InstancePropertyDescriptorMap.d.ts +32 -0
  51. package/src/utils/reflection/InstanceTypeOrSelfPropertyDescriptorMap.d.ts +20 -0
  52. package/src/utils/reflection/OwnGetterDescriptorMap.d.ts +17 -0
  53. package/src/utils/reflection/OwnKeyOf.d.ts +20 -0
  54. package/src/utils/reflection/OwnPropertyDescriptorMap.d.ts +82 -0
  55. package/src/utils/reflection/PropertyDescriptorMap.d.ts +15 -0
  56. package/src/utils/reflection/filterForGetters.ts +59 -0
  57. package/src/utils/reflection/getOwnPropertyDescriptors.ts +52 -0
  58. package/src/utils/reflection/getOwnPropertyDescriptorsRecursively.ts +127 -0
  59. package/src/utils/reflection/getPrototypeChainOf.ts +85 -0
  60. package/src/utils/reflection/getPrototypeOf.ts +12 -0
  61. package/src/utils/reflection/inheritance.ts +262 -0
  62. package/src/utils/reflection/isConstructor.ts +74 -0
  63. package/src/utils/reflection/isGetterDescriptor.ts +11 -0
  64. package/src/utils/reflection/listOwnGetters.ts +80 -0
  65. package/src/utils/reflection.ts +18 -0
  66. package/cjs/commitlintConfig-wrapper.mjs +0 -6
  67. package/cjs/commitlintConfig.cjs +0 -14
  68. package/cjs/commitlintConfig.cjs.map +0 -1
  69. package/cjs/commitlintConfig.d.ts +0 -4
  70. package/cjs/commitlintConfig.d.ts.map +0 -1
  71. package/cjs/debug.cjs +0 -13
  72. package/cjs/debug.cjs.map +0 -1
  73. package/cjs/debug.d.ts +0 -4
  74. package/cjs/debug.d.ts.map +0 -1
  75. package/cjs/dotnet/MSBuildProject.cjs +0 -84
  76. package/cjs/dotnet/MSBuildProject.cjs.map +0 -1
  77. package/cjs/dotnet/MSBuildProject.d.ts +0 -42
  78. package/cjs/dotnet/MSBuildProject.d.ts.map +0 -1
  79. package/cjs/dotnet/MSBuildProjectProperties.cjs +0 -22
  80. package/cjs/dotnet/MSBuildProjectProperties.cjs.map +0 -1
  81. package/cjs/dotnet/MSBuildProjectProperties.d.ts +0 -13
  82. package/cjs/dotnet/MSBuildProjectProperties.d.ts.map +0 -1
  83. package/cjs/dotnet/createDummyNupkg.cjs +0 -26
  84. package/cjs/dotnet/createDummyNupkg.cjs.map +0 -1
  85. package/cjs/dotnet/createDummyNupkg.d.ts +0 -2
  86. package/cjs/dotnet/createDummyNupkg.d.ts.map +0 -1
  87. package/cjs/dotnet/dotnetGHPR.cjs +0 -173
  88. package/cjs/dotnet/dotnetGHPR.cjs.map +0 -1
  89. package/cjs/dotnet/dotnetGHPR.d.ts +0 -37
  90. package/cjs/dotnet/dotnetGHPR.d.ts.map +0 -1
  91. package/cjs/dotnet/dotnetGLPR.cjs +0 -41
  92. package/cjs/dotnet/dotnetGLPR.cjs.map +0 -1
  93. package/cjs/dotnet/dotnetGLPR.d.ts +0 -13
  94. package/cjs/dotnet/dotnetGLPR.d.ts.map +0 -1
  95. package/cjs/dotnet/dotnetHelpers.cjs +0 -141
  96. package/cjs/dotnet/dotnetHelpers.cjs.map +0 -1
  97. package/cjs/dotnet/dotnetHelpers.d.ts +0 -26
  98. package/cjs/dotnet/dotnetHelpers.d.ts.map +0 -1
  99. package/cjs/dotnet-wrapper.mjs +0 -6
  100. package/cjs/dotnet.cjs +0 -15
  101. package/cjs/dotnet.cjs.map +0 -1
  102. package/cjs/dotnet.d.ts +0 -7
  103. package/cjs/dotnet.d.ts.map +0 -1
  104. package/cjs/envUtils-wrapper.mjs +0 -6
  105. package/cjs/envUtils.cjs +0 -37
  106. package/cjs/envUtils.cjs.map +0 -1
  107. package/cjs/envUtils.d.ts +0 -15
  108. package/cjs/envUtils.d.ts.map +0 -1
  109. package/cjs/eslintConfig-wrapper.mjs +0 -6
  110. package/cjs/eslintConfig.cjs +0 -52
  111. package/cjs/eslintConfig.cjs.map +0 -1
  112. package/cjs/eslintConfig.d.ts +0 -3
  113. package/cjs/eslintConfig.d.ts.map +0 -1
  114. package/cjs/findStaticConfig-wrapper.mjs +0 -6
  115. package/cjs/findStaticConfig.cjs +0 -34
  116. package/cjs/findStaticConfig.cjs.map +0 -1
  117. package/cjs/findStaticConfig.d.ts +0 -2
  118. package/cjs/findStaticConfig.d.ts.map +0 -1
  119. package/cjs/index-wrapper.mjs +0 -6
  120. package/cjs/index.cjs +0 -10
  121. package/cjs/index.cjs.map +0 -1
  122. package/cjs/index.d.ts +0 -5
  123. package/cjs/index.d.ts.map +0 -1
  124. package/cjs/semantic-release__commit-analyzer.d.cjs +0 -2
  125. package/cjs/semantic-release__commit-analyzer.d.cjs.map +0 -1
  126. package/cjs/semantic-release__git.d.cjs +0 -2
  127. package/cjs/semantic-release__git.d.cjs.map +0 -1
  128. package/cjs/semantic-release__github.d.cjs +0 -2
  129. package/cjs/semantic-release__github.d.cjs.map +0 -1
  130. package/cjs/semanticReleaseConfig-wrapper.mjs +0 -6
  131. package/cjs/semanticReleaseConfig.cjs +0 -33
  132. package/cjs/semanticReleaseConfig.cjs.map +0 -1
  133. package/cjs/semanticReleaseConfig.d.ts +0 -4
  134. package/cjs/semanticReleaseConfig.d.ts.map +0 -1
  135. package/cjs/semanticReleaseConfigDotnet-wrapper.mjs +0 -7
  136. package/cjs/semanticReleaseConfigDotnet.cjs +0 -112
  137. package/cjs/semanticReleaseConfigDotnet.cjs.map +0 -1
  138. package/cjs/semanticReleaseConfigDotnet.d.ts +0 -51
  139. package/cjs/semanticReleaseConfigDotnet.d.ts.map +0 -1
  140. package/cjs/setupGitPluginSpec-wrapper.mjs +0 -6
  141. package/cjs/setupGitPluginSpec.cjs +0 -67
  142. package/cjs/setupGitPluginSpec.cjs.map +0 -1
  143. package/cjs/setupGitPluginSpec.d.ts +0 -19
  144. package/cjs/setupGitPluginSpec.d.ts.map +0 -1
  145. package/src/dotnet/createDummyNupkg.ts +0 -30
  146. package/src/dotnet/dotnetGHPR.ts +0 -232
  147. package/src/dotnet/dotnetGLPR.ts +0 -46
  148. package/src/dotnet/dotnetHelpers.ts +0 -184
  149. package/src/dotnet.ts +0 -6
  150. package/src/envUtils.ts +0 -36
  151. package/src/findStaticConfig.ts +0 -31
  152. package/static/.releaserc.yml +0 -35
package/README.md CHANGED
@@ -1,14 +1,11 @@
1
1
  # HCE.Shared
2
2
 
3
- ## NOTICE
4
-
5
- > Activity is held up by a rewrite for the `next/3.0.0` branch.
6
- >
7
- > A fix for the `2.x` branch may be feasible if all that's wrong is async functions in CJS. The `2.x` release channel will not receive feature updates, but fixes and dependency updates are acceptable.
3
+ [![.github/workflows/npm-release.yml](https://github.com/HaloSPV3/HCE.Shared/actions/workflows/npm-release.yml/badge.svg?branch=next%2F3.x&event=push)](https://github.com/HaloSPV3/HCE.Shared/actions/workflows/npm-release.yml)
8
4
 
9
5
  Infrastructure resources shared with other HaloSPV3 repositories.
10
6
 
11
- It is recommended to "install" this repo via [Node Package Manager](#npm)
7
+ **NOTE**
8
+ HCE.Shared's API offers convenience and flexibility not present in similar .NET/NuGet-publishing NPM packages, but this project is incredibly messy. You'll find many traces of scrapped or unfinished ideas in the form of both documentation and code. These wrinkles will be ironed out before `3.x` is merged into `main`.
12
9
 
13
10
  ## Usage
14
11
 
@@ -26,7 +23,7 @@ WARNING! Defining a property will _overwrite_ the previous value. Arrays and
26
23
  objects are _not_ merged. You can...
27
24
 
28
25
  - Assign to certain top-level variables (e.g. `options.preset`) to avoid
29
- modifying the plugins array. Caveat: only *some* plugins read these properties.
26
+ modifying the plugins array. Caveat: only _some_ plugins read these properties.
30
27
  - Write your config in MJS; It is recommended you use
31
28
  [deepmerge](https://www.npmjs.com/package/deepmerge) to recursively merge
32
29
  objects and arrays instead of using `extends`. Doing so will allow your IDE to
@@ -41,11 +38,11 @@ objects are _not_ merged. You can...
41
38
  > - Configures [`@semantic-release/git`](https://github.com/semantic-release/git) to add README.md and CHANGELOG.md in a release commit if they have changes. Uses GitHub job's token to commit.
42
39
  > - Configures [`@semantic-release/github`](https://github.com/semantic-release/github) to release all files found in `$PWD/publish`.
43
40
 
44
- ##### Usage
41
+ ##### Base Config - Usage
45
42
 
46
43
  ```js
47
44
  // releaserc.config.js
48
- import hceSharedConfig from "@halospv3/hce.shared-config"
45
+ import hceSharedConfig from '@halospv3/hce.shared-config';
49
46
 
50
47
  // modify it however you wish before the export statement!
51
48
 
@@ -55,55 +52,62 @@ export default hceSharedConfig;
55
52
  ```js
56
53
  // releaserc.config.js
57
54
  export default {
58
- extends: ["@halospv3/hce.shared-config"]
59
- }
55
+ extends: ['@halospv3/hce.shared-config'],
56
+ };
60
57
  ```
61
58
 
62
59
  ```json
63
60
  // package.json
64
61
  {
65
- "release": {
66
- "extends": ["@halospv3/hce.shared-config"]
67
- }
62
+ "release": {
63
+ "extends": ["@halospv3/hce.shared-config"]
64
+ }
68
65
  }
69
66
  ```
70
67
 
71
68
  #### Dotnet Config
72
69
 
73
70
  > An extension of our base config.
71
+ >
74
72
  > Exports a function with parameters for 'projects to pack' and 'projects to push (to nuget)'.
75
73
  > Although `@halospv3/hce.shared-config/semanticReleaseConfigDotnet` can be used
76
- via `extends` and configured via the `PROJECTS_TO_PUBLISH` and
77
- `PROJECTS_TO_PACK_AND_PUSH` environment variables, it is recommended to call
78
- the function and pass it parameters so errors are caught before they reach
79
- production.
74
+ > via `extends` and configured via the `PROJECTS_TO_PUBLISH` and
75
+ > `PROJECTS_TO_PACK_AND_PUSH` environment variables, it is recommended to call
76
+ > the function and pass it parameters so errors are caught before they reach
77
+ > production.
80
78
  >
81
79
  > Differences to the base config:
80
+ >
82
81
  > - Utilizes `@semantic-release/exec` for shell commands.
83
82
  > - Executes `dotnet publish` and `dotnet pack` upon the configured projects during the `prepare` step.
84
83
  > - (WIP) Executes `dotnet nuget sign` during `prepare` upon the `dotnet pack` outputs if `projectsToPackAndPush` is not set to `false` (default: `[]`).
85
84
  > - Executes `dotnet nuget push` during the `publish` step.
86
85
 
87
- ##### Usage
86
+ ##### Dotnet Config - Usage
88
87
 
89
- ```js
88
+ TODO: add "non-best-guess" config example
89
+
90
+ For a basic "best-guess" config...
91
+
92
+ ```ts
90
93
  // releaserc.config.js
91
- import { getConfig } from "@halospv3/hce.shared-config/semanticReleaseConfigDotnet"
94
+ // TODO: getConfig was removed. Update instructions!
95
+ import { getConfig } from '@halospv3/hce.shared-config/semanticReleaseConfigDotnet';
92
96
 
93
97
  /* Caveat: semantic-release will version and release all specified projects under the same Git tags and GitHub releases.
94
98
  * To version and release them separately, use [https://github.com/pmowrer/semantic-release-monorepo](semantic-release-monorepo).
95
99
  */
96
100
 
97
- /* `prepareCmd` will contain command lines to publish
101
+ /* `prepareCmd` will contain command lines to publish
98
102
  * both Library and Sample to your GitHub release.
99
103
  * Their `TargetFrameworks` and `RuntimeIdentifiers`
100
- * properties will be evaluated and a command line
101
- * will be added for each unique combination,
104
+ * properties will be evaluated and a command line
105
+ * will be added for each unique combination,
102
106
  * _regardless of compatibility and intended combinations_.
103
107
  */
104
108
  const projectsToPublish = [
105
- "./Library/Library.csproj",
106
- "./Sample/Sample.csproj"
109
+ './Library/Library.csproj',
110
+ './Sample/Sample.csproj',
107
111
  ];
108
112
  /*
109
113
  * `prepareCmd` will also contain `dotnet pack` and
@@ -111,28 +115,29 @@ const projectsToPublish = [
111
115
  * `publishCmd` will contain `dotnet nuget push` commands
112
116
  * to push Library to Nuget.org and GitHub Package Registry.
113
117
  */
114
- const projectsToPackAndPush = ["./Library/Library.csproj"];
118
+ const projectsToPackAndPush = ['./Library/Library.csproj'];
115
119
 
116
120
  // runs getConfig and exports its return value
117
- export default getConfig(projectsToPublish, projectsToPackAndPush)
121
+ export default await getConfig(projectsToPublish, projectsToPackAndPush);
118
122
  ```
119
123
 
120
124
  ###### `extends` key in a javascript config file
121
125
 
122
126
  Using `extends` is NOT recommended, but I won't stop you.
123
127
  Your projects' paths must be assigned to environment variables. See [Dotnet Config](#dotnet-config).
128
+
124
129
  ```js
125
130
  // releaserc.config.js (if {"type": "module"} in package.json)
126
131
  export default {
127
- extends: ["@halospv3/hce.shared-config"]
128
- }
132
+ extends: ['@halospv3/hce.shared-config'],
133
+ };
129
134
  ```
130
135
 
131
136
  ```js
132
137
  // releaserc.config.js (if {"type": "commonjs"} in package.json)
133
138
  module.exports = {
134
- extends: ["@halospv3/hce.shared-config"]
135
- }
139
+ extends: ['@halospv3/hce.shared-config'],
140
+ };
136
141
  ```
137
142
 
138
143
  ###### `release` key in package.json
@@ -141,47 +146,49 @@ module.exports = {
141
146
  // package.json
142
147
  // `npm install --save-dev cross-env`
143
148
  {
144
- "scripts":{
145
- "release":"cross-env PROJECTS_TO_PUBLISH=\"./Library/Library.csproj;./Sample/Sample.csproj\" semantic-release"
146
- },
147
- "release": {
148
- "extends": ["@halospv3/hce.shared-config/semanticReleaseConfigDotnet"]
149
- }
149
+ "scripts": {
150
+ "release": "cross-env PROJECTS_TO_PUBLISH=\"./Library/Library.csproj;./Sample/Sample.csproj\" semantic-release"
151
+ },
152
+ "release": {
153
+ "extends": ["@halospv3/hce.shared-config/semanticReleaseConfigDotnet"]
154
+ }
150
155
  }
151
156
  ```
152
157
 
153
158
  ---
154
159
 
155
- **Notable Plugin Properties**
160
+ #### Notable Plugin Properties
156
161
 
157
162
  - [`@semantic-release/commit-analyzer`](https://github.com/semantic-release/commit-analyzer#options)
158
- - preset (set to `conventionalcommits`)
159
- - parserOpts
160
- - releaseRules
163
+ - preset (set to `conventionalcommits`)
164
+ - parserOpts
165
+ - releaseRules
161
166
  - [`@semantic-release/release-notes-generator`](https://github.com/semantic-release/release-notes-generator#options)
162
- - preset (set to `conventionalcommits`)
163
- - parserOpts
164
- - writerOpts
167
+ - preset (set to `conventionalcommits`)
168
+ - parserOpts
169
+ - writerOpts
165
170
  - [`@semantic-release/changelog`](https://github.com/semantic-release/changelog#options)
166
- - changelogFile (default: `'CHANGELOG.md'`)
171
+ - changelogFile (default: `'CHANGELOG.md'`)
167
172
  - [`@semantic-release/git`](https://github.com/semantic-release/git#options)
168
- - assets (default: `['README.md', 'CHANGELOG.md', 'package.json', 'package-lock.json', 'npm-shrinkwrap.json']`)
173
+ - assets (default:
174
+ `['README.md', 'CHANGELOG.md', 'package.json', 'package-lock.json', 'npm-shrinkwrap.json']`)
169
175
  - `@semantic-release/exec`
170
- - prepareCmd
176
+ - prepareCmd
171
177
  - [`@semantic-release/github`](https://github.com/semantic-release/github#options)
172
- - assets
173
- - draftRelease (default: false)
178
+ - assets
179
+ - draftRelease (default: false)
174
180
 
175
181
  ### 3. Set Up CommitLint
176
182
 
177
183
  ```json
178
184
  // package.json
179
185
  {
180
- "commitlint": {
181
- "extends": ["@halospv3/hce.shared-config/commitlintConfig"]
182
- }
186
+ "commitlint": {
187
+ "extends": ["@halospv3/hce.shared-config/commitlintConfig"]
188
+ }
183
189
  }
184
190
  ```
191
+
185
192
  or
186
193
 
187
194
  ```ts
@@ -192,6 +199,7 @@ export default commitlintConfig;
192
199
  ```
193
200
 
194
201
  Then...
202
+
195
203
  ```sh
196
204
  npx husky
197
205
  npx husky add .husky/commit-msg 'npx --no -- commitlint --edit ${1}'
@@ -201,21 +209,22 @@ npx husky add .husky/commit-msg 'npx --no -- commitlint --edit ${1}'
201
209
 
202
210
  ```xml
203
211
  <Project>
204
- <Import Project="$(HCESharedDir)/dotnet/HCE.Shared.targets"/>
212
+ <Import Project="$(HCESharedDir)/dotnet/HCE.Shared.targets"/>
205
213
 
206
- <PropertyGroup>
207
- <RepoRoot Condition="'$(RepoRoot)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), '.git/index'))</RepoRoot>
208
- <HCESharedDir Condition="'$(HCESharedDir)' == ''">$(RepoRoot)node_modules/@halospv3/hce.shared-config/</HCESharedDir>
209
- <!--<GitVersion_Path Condition="'$(GitVersion_Path)' == ''">Path/To/Your/GitVersion.yml</GitVersion_Path>-->
210
- </PropertyGroup>
214
+ <PropertyGroup>
215
+ <RepoRoot Condition="'$(RepoRoot)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), '.git/index'))</RepoRoot>
216
+ <HCESharedDir Condition="'$(HCESharedDir)' == ''">$(RepoRoot)node_modules/@halospv3/hce.shared-config/</HCESharedDir>
217
+ <!--<GitVersion_Path Condition="'$(GitVersion_Path)' == ''">Path/To/Your/GitVersion.yml</GitVersion_Path>-->
218
+ </PropertyGroup>
211
219
  </Project>
212
220
  ```
213
221
 
214
222
  These may evaluate to the following:
215
- | Property | Evaluated Value|
216
- | ------------ | -------------- |
217
- |`RepoRootDir` | `c:\Repos\HaloSPV3\HCE.Shared\` |
218
- |`HCESharedDir`| `c:\Repos\HaloSPV3\HCE.Shared\node_modules\@halospv3\hce.shared-config\` |
223
+
224
+ | Property | Evaluated Value |
225
+ | -------------- | ------------------------------------------------------------------------ |
226
+ | `RepoRootDir` | `c:\Repos\HaloSPV3\HCE.Shared\` |
227
+ | `HCESharedDir` | `c:\Repos\HaloSPV3\HCE.Shared\node_modules\@halospv3\hce.shared-config\` |
219
228
 
220
229
  #### CI/CD-Only Properties
221
230
 
@@ -227,15 +236,15 @@ conditional property group to the props file:
227
236
 
228
237
  ```xml, diff
229
238
  <Project>
230
- <PropertyGroup>
231
- ...
232
- </PropertyGroup>
233
-
234
- <PropertyGroup Condition=" '$(CI)' == 'true' ">
235
- <Configuration>Release</Configuration>
236
- <ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
237
- <Deterministic>true</Deterministic>
238
- </PropertyGroup>
239
+ <PropertyGroup>
240
+ ...
241
+ </PropertyGroup>
242
+
243
+ <PropertyGroup Condition=" '$(CI)' == 'true' ">
244
+ <Configuration>Release</Configuration>
245
+ <ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
246
+ <Deterministic>true</Deterministic>
247
+ </PropertyGroup>
239
248
  </Project>
240
249
  ```
241
250
 
@@ -256,25 +265,28 @@ packages.
256
265
  You can...
257
266
 
258
267
  ...define it yourself
268
+
259
269
  ```xml
260
270
  <Project>
261
- <PropertyGroup>
262
- <GitVersion_Path>$(ProjectRootDir)/node_modules/@halospv3/hce.shared-config/dotnet/GitVersion.yml</GitVersion_Path>
263
- </PropertyGroup>
271
+ <PropertyGroup>
272
+ <GitVersion_Path>$(ProjectRootDir)/node_modules/@halospv3/hce.shared-config/dotnet/GitVersion.yml</GitVersion_Path>
273
+ </PropertyGroup>
264
274
  </Project>
265
275
  ```
266
276
 
267
277
  ...import HCE.Shared.props
278
+
268
279
  ```xml
269
280
  <Project>
270
- <Import Project="$(HCESharedDir)/dotnet/HCE.Shared.props">
281
+ <Import Project="$(HCESharedDir)/dotnet/HCE.Shared.props">
271
282
  </Project>
272
283
  ```
273
284
 
274
285
  ...import HCE.Shared.Targets (which imports HCE.Shared.props)
286
+
275
287
  ```xml
276
288
  <Project>
277
- <Import Project="$(HCESharedDir)/dotnet/HCE.Shared.props">
289
+ <Import Project="$(HCESharedDir)/dotnet/HCE.Shared.props">
278
290
  </Project>
279
291
  ```
280
292
 
@@ -286,6 +298,7 @@ If you want to use this information in other Semantic Release steps, you'll need
286
298
  `semantic-release-export-data`.
287
299
 
288
300
  Run the following to preview the version:
301
+
289
302
  ```sh
290
303
  npx semantic-release --dry-run --plugins "@semantic-release/commit-analyzer,semantic-release-export-data"
291
304
  ```
@@ -301,7 +314,7 @@ Add the following to `package.json`:
301
314
 
302
315
  ```json
303
316
  {
304
- "private": true,
317
+ "private": true
305
318
  }
306
319
  ```
307
320
 
@@ -313,13 +326,13 @@ See callable workflows such as [dotnet-ci](./.github/workflows/dotnet-ci.yml)
313
326
 
314
327
  ```yml
315
328
  jobs:
316
- release:
317
- steps:
318
- - uses: actions/checkout@v3
319
- - name: dotnet build/publish; copy release artifacts to './publish/'
320
- uses: ./node_modules/@halospv3/hce.shared/dotnet/.github/workflows/dotnet-release.yml
321
- with:
322
- projects:
323
- - src/lib/lib.csproj
324
- - src/lib-sample/sample.csproj
329
+ release:
330
+ steps:
331
+ - uses: actions/checkout@v3
332
+ - name: dotnet build/publish; copy release artifacts to './publish/'
333
+ uses: ./node_modules/@halospv3/hce.shared/dotnet/.github/workflows/dotnet-release.yml
334
+ with:
335
+ projects:
336
+ - src/lib/lib.csproj
337
+ - src/lib-sample/sample.csproj
325
338
  ```
@@ -2,7 +2,7 @@
2
2
  on:
3
3
  workflow_call:
4
4
  env:
5
- DOTNET_ROLL_FORWARD: "Major"
5
+ DOTNET_ROLL_FORWARD: 'Major'
6
6
 
7
7
  jobs:
8
8
  unit_test:
@@ -14,12 +14,15 @@ jobs:
14
14
 
15
15
  runs-on: ${{ matrix.os }}
16
16
  steps:
17
+ - uses: GitHubSecurityLab/actions-permissions/monitor@v1
18
+ with:
19
+ config: ${{ vars.PERMISSIONS_CONFIG }}
17
20
  - uses: actions/checkout@v4
18
21
  with:
19
22
  fetch-depth: 0
20
23
  - uses: actions/setup-node@v4
21
24
  with:
22
- cache: "npm"
25
+ cache: 'npm'
23
26
  check-latest: true
24
27
  node-version-file: package.json
25
28
  - run: npm i -g npm@latest
@@ -27,6 +30,6 @@ jobs:
27
30
 
28
31
  - uses: actions/setup-dotnet@v4.3.1
29
32
  with:
30
- dotnet-version: "8.x"
33
+ dotnet-version: '8.x'
31
34
 
32
35
  - run: dotnet test
@@ -11,7 +11,7 @@ on:
11
11
  workflow_call:
12
12
 
13
13
  env:
14
- DOTNET_ROLL_FORWARD: "Major"
14
+ DOTNET_ROLL_FORWARD: 'Major'
15
15
  DOTNET_CLI_TELEMETRY_OPTOUT: 1
16
16
  DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
17
17
  DOTNET_NOLOGO: 1
@@ -19,4 +19,4 @@ env:
19
19
  jobs:
20
20
  unit_test:
21
21
  name: Unit Test
22
- uses: ./.github/workflows/_unit_test.yml # <- your unit test workflow here. Example: file://./_unit_test.yml
22
+ uses: ./dotnet/.github/workflows/_unit_test.yml # <- your unit test workflow here. Example: file://./_unit_test.yml
@@ -6,16 +6,16 @@ name: dotnet-release
6
6
 
7
7
  on:
8
8
  push:
9
- branches: [ main, develop ]
9
+ branches: [main, develop]
10
10
  paths-ignore:
11
- - ".github/**/*.*"
12
- - "**/*.md"
13
- - "**/*.txt"
11
+ - '.github/**/*.*'
12
+ - '**/*.md'
13
+ - '**/*.txt'
14
14
 
15
15
  jobs:
16
16
  ci:
17
17
  name: CI # run test.yml. If it fails, this job fails.
18
- uses: ./.github/workflows/ci.yml # <- your CI workflow here. Example: 'file://./ci.yml'
18
+ uses: ./dotnet/.github/workflows/ci.yml # <- your CI workflow here. Example: 'file://./ci.yml'
19
19
  release:
20
20
  needs: [ci] # start 'release' if 'ci' completes successfully
21
21
  runs-on: ubuntu-latest
@@ -24,27 +24,30 @@ jobs:
24
24
  issues: write
25
25
  pull-requests: write
26
26
  steps:
27
- ################
28
- # SETUP
29
- ################
30
- - uses: actions/checkout@v4
31
- with:
32
- fetch-depth: 0 # Required by GitVersion, Semantic Release
33
- submodules: "recursive" # submodule fetch depth unknown
34
- - uses: actions/setup-dotnet@v4
35
- - uses: actions/setup-node@v4
36
- - run: npm install -g npm@latest
37
- - run: npm ci # Required by Semantic Release
27
+ - uses: GitHubSecurityLab/actions-permissions/monitor@v1
28
+ with:
29
+ config: ${{ vars.PERMISSIONS_CONFIG }}
30
+ ################
31
+ # SETUP
32
+ ################
33
+ - uses: actions/checkout@v4
34
+ with:
35
+ fetch-depth: 0 # Required by GitVersion, Semantic Release
36
+ submodules: 'recursive' # submodule fetch depth unknown
37
+ - uses: actions/setup-dotnet@v4
38
+ - uses: actions/setup-node@v4
39
+ - run: npm install -g npm@latest
40
+ - run: npm ci # Required by Semantic Release
38
41
 
39
- ################
40
- # RELEASE
41
- # @semantic-release/exec should be configured to execute
42
- # `dotnet publish`, `dotnet pack`, and `dotnet nuget push`
43
- # You can use this package's semanticReleaseConfigDotnet exports to do so.
44
- ################
45
- # https://github.com/semantic-release/semantic-release
46
- - name: Semantic Release
47
- run: npx semantic-release
48
- env:
49
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50
- NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}
42
+ ################
43
+ # RELEASE
44
+ # @semantic-release/exec should be configured to execute
45
+ # `dotnet publish`, `dotnet pack`, and `dotnet nuget push`
46
+ # You can use this package's semanticReleaseConfigDotnet exports to do so.
47
+ ################
48
+ # https://github.com/semantic-release/semantic-release
49
+ - name: Semantic Release
50
+ run: npx semantic-release
51
+ env:
52
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53
+ NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}
@@ -9,15 +9,20 @@ jobs:
9
9
  build:
10
10
  runs-on: ubuntu-latest
11
11
  steps:
12
- - uses: actions/checkout@v4
13
- with:
14
- submodules: 'recursive'
15
- fetch-depth: 0
16
- - uses: actions/setup-dotnet@v4
12
+ - uses: GitHubSecurityLab/actions-permissions/monitor@v1
13
+ with:
14
+ config: ${{ vars.PERMISSIONS_CONFIG }}
15
+ - uses: actions/checkout@v4
16
+ with:
17
+ submodules: 'recursive'
18
+ fetch-depth: 0
19
+ - uses: actions/setup-dotnet@v4
17
20
 
18
- - run: dotnet build src/SPV3.csproj -c Release -p:ContinuousIntegrationBuild=true
19
- # ContinuousIntegrationBuild comes from dotnet/sourcelink.
20
- # Make sure Deterministic is also true!
21
- # If you use this package's dotnet props/targets files, you're good to go!
22
- #
23
- # Alternatively, add a PropertyGroup with the condition " '$(CI)' != '' "
21
+ - run:
22
+ dotnet build src/SPV3.csproj -c Release
23
+ -p:ContinuousIntegrationBuild=true
24
+ # ContinuousIntegrationBuild comes from dotnet/sourcelink.
25
+ # Make sure Deterministic is also true!
26
+ # If you use this package's dotnet props/targets files, you're good to go!
27
+ #
28
+ # Alternatively, add a PropertyGroup with the condition " '$(CI)' != '' "
@@ -0,0 +1,20 @@
1
+ <h1 align="center">ExecNupkgDeterministicator.target</h1>
2
+
3
+ This target runs after "Pack" and utilizes `kuinox.nupkgdeterministicator` to make the nupkg (and snupkg!) deterministic. However, this target does not include `kuinox.nupkgdeterministicator`. As such, an Error task will be executed if the dotnet tool `kuinox.nupkgdeterministicator` is not installed locally nor globally. Cake and NUKE are not supported by this MSBuild Target.
4
+
5
+ Learn more about Kuinox's NupkgDeterministicator\
6
+ [GitHub](https://github.com/Kuinox/NupkgDeterministicator) | [Nuget](https://www.nuget.org/packages/Kuinox.NupkgDeterministicator)
7
+
8
+ ## Install `kuinox.nupkgdeterministicator`
9
+
10
+ ### .NET CLI (Global)
11
+
12
+ ```sh
13
+ dotnet tool install -g NupkgDeterministicator
14
+ ```
15
+
16
+ ### .NET CLI (Local)
17
+
18
+ ```sh
19
+ dotnet tool install -g NupkgDeterministicator
20
+ ```