@benshawmean/envedit 1.2.1 → 1.2.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.
package/.gitlab-ci.yml CHANGED
@@ -1,13 +1,11 @@
1
1
  stages:
2
2
  - test
3
- - deploy
3
+ - publish
4
4
 
5
5
  workflow:
6
6
  rules:
7
7
  - if: $CI_COMMIT_BRANCH
8
8
  - if: $CI_COMMIT_TAG
9
- - if: $CI_COMMIT_DESCRIPTION =~ /(no|skip)\s+(ci|pipeline)/mi
10
- when: never
11
9
 
12
10
  default:
13
11
  image: oven/bun:debian
@@ -21,25 +19,27 @@ default:
21
19
  variables:
22
20
  GLAB_NPM_REG: ${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/
23
21
  VERSION_REGEX: /^v\d+\.\d+\.\d+(-\S*)?$/
24
- NO_CI_REGEX: /(no|skip)\s+(ci|pipeline)/mi
25
22
 
26
23
  test:
27
24
  stage: test
25
+
28
26
  rules:
29
27
  - if: $CI_COMMIT_TAG || $CI_COMMIT_MESSAGE =~ $VERSION_REGEX
30
28
  when: never
31
- - if: $CI_COMMIT_DESCRIPTION =~ $NO_CI_REGEX
32
- when: never
33
29
  - if: $CI_COMMIT_BRANCH
34
30
  when: always
31
+
35
32
  allow_failure: false
33
+
36
34
  script:
37
35
  - bun test
38
36
  - sed 's/amp;//' coverage/junit.xml > coverage/junit.xml.tmp # remove amp; from junit report to prevent gitlab parsing issues
39
37
  - mv coverage/junit.xml.tmp coverage/junit.xml # make the change permanent
40
38
  - cargo install -q lcov2xml # used to convert lcov output to cobertura-xml for gitlab code coverage parsing
41
39
  - lcov2xml coverage/lcov.info -o coverage/cobertura-coverage.xml
40
+
42
41
  coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/
42
+
43
43
  artifacts:
44
44
  reports:
45
45
  junit: ./coverage/junit.xml
@@ -47,18 +47,19 @@ test:
47
47
  coverage_format: cobertura
48
48
  path: ./coverage/cobertura-coverage.xml
49
49
 
50
- deploy:
51
- stage: deploy
50
+ publish:
51
+ stage: publish
52
+
52
53
  id_tokens:
53
54
  SIGSTORE_ID_TOKEN:
54
55
  aud: sigstore
55
56
  NPM_ID_TOKEN:
56
57
  aud: "npm:registry.npmjs.org"
58
+
57
59
  rules:
58
60
  - if: $CI_COMMIT_REF_PROTECTED && $CI_COMMIT_TAG && $CI_COMMIT_TAG =~ $VERSION_REGEX
59
61
  when: always
60
- - if: $CI_COMMIT_DESCRIPTION =~ $NO_CI_REGEX
61
- when: never
62
+
62
63
  script:
63
64
  - | # Setup environment variables for deployment
64
65
  export PACKAGE_NAME=$(jq -r '.name' package.json)
@@ -71,13 +72,11 @@ deploy:
71
72
  exit 9001
72
73
  fi
73
74
 
74
- - | # Publish to npm and GitLab registries
75
- echo "//${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/:_authToken=${CI_JOB_TOKEN}" > .npmrc
76
- bun pm pack --filename package.tgz
77
- bunx npm publish -q package.tgz
78
-
79
- bun publish --silent --registry https://${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/ package.tgz
80
- rm package.tgz .npmrc
75
+ - bun pm pack --filename package.tgz
76
+ - bunx npm publish -q package.tgz
77
+ - sh ci/npm.sh
78
+ - bun publish --silent package.tgz
79
+ - rm package.tgz .npmrc
81
80
 
82
81
  allow_failure:
83
82
  exit_codes:
package/ci/npm.sh ADDED
@@ -0,0 +1,4 @@
1
+ #! /usr/bin/env bash
2
+
3
+ echo "//${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/:_authToken=${CI_JOB_TOKEN}" > .npmrc
4
+ echo "@${CI_PROJECT_ROOT_NAMESPACE}:registry=https://${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/" >> .npmrc
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@benshawmean/envedit",
3
3
  "module": "index.ts",
4
4
  "type": "module",
5
- "version": "1.2.1",
5
+ "version": "1.2.2",
6
6
  "license": "GPL-3.0-only",
7
7
  "bin": {
8
8
  "envedit": "index.ts"