@ethima/semantic-release-configuration 3.2.2 → 3.3.1

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 (3) hide show
  1. package/README.md +14 -0
  2. package/package.json +2 -2
  3. package/src/index.js +37 -0
package/README.md CHANGED
@@ -23,6 +23,10 @@ configuration supporting a range of languages and platforms supported by the
23
23
  - (Conditionally) maintains NPM package files, i.e. `package.json` and
24
24
  publishes using [`@semantic-release/npm`][semantic-release-npm-plugin-url]
25
25
  and [`@semantic-release/git`][semantic-release-git-plugin-url].
26
+ - (Conditionally) maintains Julia package files, i.e. `version` fields in
27
+ `Project.toml` files, using
28
+ [`@google/semantic-release-replace-plugin`][semantic-release-replace-plugin-url]
29
+ and [`@semantic-release/git`][semantic-release-git-plugin-url].
26
30
  - Publishes releases to the relevant hosting platform, i.e. GitHub or GitLab,
27
31
  using the platform-specific release plugins
28
32
  [`@semantic-release/github`][semantic-release-github-plugin-url] or
@@ -93,6 +97,15 @@ in the root of the project.
93
97
  instructions][semantic-release-npm-plugin-configuration-url] for details and
94
98
  alternatives.
95
99
 
100
+ ### Julia Packages
101
+
102
+ Julia packages are detected based on the presence of a `Project.toml` file in
103
+ the root of the project.
104
+
105
+ The configuration is not able to automatically register releases with the
106
+ General registry. Newly created releases should be registered using [JuliaHub's
107
+ _Register Packages_ interface][juliahub-register-package-url].
108
+
96
109
  ### Templated Content in `README.md` Files
97
110
 
98
111
  The configuration will look for `__NEXT_SEMANTIC_RELEASE_VERSION__` tokens in
@@ -201,6 +214,7 @@ release by hand from the tag and changelog that was created by the
201
214
  [conventionalcommits-preset-url]: https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-conventionalcommits
202
215
  [cosmiconfig-url]: https://www.npmjs.com/package/cosmiconfig
203
216
  [gitlab-predefined-variables-url]: https://docs.gitlab.com/ee/ci/variables/predefined_variables.html
217
+ [juliahub-register-package-url]: https://juliahub.com/ui/Registrator
204
218
  [npm-token-url]: https://docs.npmjs.com/creating-and-viewing-access-tokens#creating-granular-access-tokens-on-the-website
205
219
  [replace-in-file-url]: https://www.npmjs.com/package/replace-in-file
206
220
  [semantic-release-changelog-plugin-url]: https://github.com/semantic-release/changelog
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethima/semantic-release-configuration",
3
- "version": "3.2.2",
3
+ "version": "3.3.1",
4
4
  "description": "A shareable semantic release configuration supporting a range of languages and platforms supported by the Ethima organization.",
5
5
  "main": "./src/index.js",
6
6
  "repository": {
@@ -22,7 +22,7 @@
22
22
  "@semantic-release/changelog": "6.0.2",
23
23
  "@semantic-release/git": "10.0.1",
24
24
  "@semantic-release/github": "8.0.7",
25
- "@semantic-release/gitlab": "10.1.4",
25
+ "@semantic-release/gitlab": "11.0.1",
26
26
  "conventional-changelog-conventionalcommits": "5.0.0",
27
27
  "cosmiconfig": "8.0.0"
28
28
  }
package/src/index.js CHANGED
@@ -39,6 +39,42 @@ try {
39
39
  NPM_PLUGIN.push("@semantic-release/npm");
40
40
  } catch {}
41
41
 
42
+ const JULIA_PROJECT_TOML_PLUGIN = [];
43
+ try {
44
+ accessSync("Project.toml");
45
+ GIT_ASSETS.push("Project.toml");
46
+ JULIA_PROJECT_TOML_PLUGIN.push([
47
+ "@google/semantic-release-replace-plugin",
48
+ {
49
+ replacements: [
50
+ {
51
+ files: "Project.toml",
52
+ // Only a single `version` field should be present in the
53
+ // `Project.toml`. However, due to the behavior of the `String.match`
54
+ // function used under the hood by the `replace-in-file` plugin to
55
+ // count the number of matches and replacements, it is necessary to
56
+ // set the `g` modifier on the regular expression to only count the
57
+ // actual number of matches instead of the first match and any
58
+ // capturing groups.
59
+ //
60
+ // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match#return_value
61
+ from: /version\s*=\s*"\d+(\.\d+){2}"/g,
62
+ to: 'version = "${nextRelease.version}"',
63
+ results: [
64
+ {
65
+ file: "Project.toml",
66
+ hasChanged: true,
67
+ numMatches: 1,
68
+ numReplacements: 1,
69
+ },
70
+ ],
71
+ countMatches: true,
72
+ },
73
+ ],
74
+ },
75
+ ]);
76
+ } catch {}
77
+
42
78
  const SEMANTIC_RELEASE_CONFIGURATION = {
43
79
  branches: [CONFIGURATION.primary_release_branch],
44
80
  plugins: [
@@ -55,6 +91,7 @@ const SEMANTIC_RELEASE_CONFIGURATION = {
55
91
  CONFIGURATION.files_with_versioned_templates
56
92
  ),
57
93
  ...NPM_PLUGIN,
94
+ ...JULIA_PROJECT_TOML_PLUGIN,
58
95
  [
59
96
  "@semantic-release/git",
60
97
  {