git-tag-generate 0.0.2 → 0.0.3
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/.github/workflows/npm-publish.yml +23 -0
- package/README.md +33 -2
- package/package.json +1 -1
- package/src/tagList.js +12 -3
- package/src/tagNew.js +5 -3
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
|
2
|
+
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
|
|
3
|
+
|
|
4
|
+
name: Release by npmjs.com
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
release:
|
|
8
|
+
types: [created]
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
publish-npm:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- name: Checkout
|
|
15
|
+
uses: actions/checkout@v3
|
|
16
|
+
- name: Use Node v18
|
|
17
|
+
uses: actions/setup-node@v3
|
|
18
|
+
with:
|
|
19
|
+
node-version: 18
|
|
20
|
+
registry-url: https://registry.npmjs.org/
|
|
21
|
+
- run: npm publish
|
|
22
|
+
env:
|
|
23
|
+
NODE_AUTH_TOKEN: ${{secrets.NPMJS_ACCESS_TOKEN}}
|
package/README.md
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Git Tag Generate
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
Es una herramienta para generar tags de forma fácil y rápida, teniendo en cuenta el uso de prefix en los tags.
|
|
5
|
+
|
|
6
|
+
## Instalación
|
|
7
|
+
|
|
8
|
+
La instalación global genera el comando ``gtg``.
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm i -g git-tag-generate
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Uso
|
|
15
|
+
|
|
16
|
+
Al ejecutar el comando, inicia el menú interactivo para generar el nuevo tag
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
gtg
|
|
20
|
+
|
|
21
|
+
El último tag es: strapi-0.0.2
|
|
22
|
+
? ¿Seguir con el prefix o con uno nuevo?
|
|
23
|
+
strapi
|
|
24
|
+
❯ web
|
|
25
|
+
──────────────
|
|
26
|
+
Crear nuevo prefix
|
|
27
|
+
----
|
|
28
|
+
❯ Patch web-0.0.5
|
|
29
|
+
Minor web-0.1.0
|
|
30
|
+
Major web-1.0.0
|
|
31
|
+
----
|
|
32
|
+
Se creó el tag: web-0.0.5
|
|
33
|
+
Se pusheo el tag: web-0.0.5
|
|
34
|
+
```
|
package/package.json
CHANGED
package/src/tagList.js
CHANGED
|
@@ -72,11 +72,20 @@ class TagListClass {
|
|
|
72
72
|
return (function() {
|
|
73
73
|
const args = [
|
|
74
74
|
'tag',
|
|
75
|
-
'
|
|
76
|
-
'--format', '%(refname:strip=2)',
|
|
77
|
-
'--sort', '-creatordate',
|
|
75
|
+
'--list',
|
|
78
76
|
];
|
|
79
77
|
|
|
78
|
+
if (searchPrefix === '') {
|
|
79
|
+
args.push('[0-9]*');
|
|
80
|
+
} else {
|
|
81
|
+
args.push(searchPrefix + '-*');
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
args.push('--format');
|
|
85
|
+
args.push('%(refname:strip=2)');
|
|
86
|
+
args.push('--sort');
|
|
87
|
+
args.push('-creatordate');
|
|
88
|
+
|
|
80
89
|
const spawn = childProcess.spawnSync('git', args, {encoding: 'utf-8'});
|
|
81
90
|
if (spawn.status !== 0) {
|
|
82
91
|
const errorText = spawn.stderr.toString().trim();
|
package/src/tagNew.js
CHANGED
|
@@ -53,9 +53,11 @@ class TagNewClass {
|
|
|
53
53
|
createNextTag(args, prefix) {
|
|
54
54
|
const version = TagList.getLastTagByPrefix(prefix).split('-').pop();
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const
|
|
56
|
+
prefix = (prefix === '' ? '' : prefix + '-');
|
|
57
|
+
|
|
58
|
+
const vPatch = prefix + semver.inc(version, 'patch');
|
|
59
|
+
const vMinor = prefix + semver.inc(version, 'minor');
|
|
60
|
+
const vMajor = prefix + semver.inc(version, 'major');
|
|
59
61
|
|
|
60
62
|
const newReleases = [
|
|
61
63
|
{name: 'Patch ' + vPatch, value: vPatch},
|