@hvedinich/utils 0.0.58 → 0.0.60

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.
@@ -0,0 +1,57 @@
1
+ name: Publish utils
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ update-version-publish-and-release:
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - name: Checkout code
14
+ uses: actions/checkout@v2
15
+
16
+ - name: Setup Node.js
17
+ uses: actions/setup-node@v3
18
+ with:
19
+ node-version: 18
20
+ registry-url: 'https://registry.npmjs.org/'
21
+
22
+ - name: Install dependencies
23
+ run: npm ci
24
+
25
+ - name: Update patch version
26
+ run: |
27
+ npm version patch --no-git-tag-version
28
+ git config --local user.email "rooolik@gmail.com"
29
+ git config --local user.name "hvedinich"
30
+ git commit -am "Update version to $(node -p "require('./package.json').version")"
31
+ git push
32
+
33
+ - name: Publish to npm
34
+ uses: JS-DevTools/npm-publish@v3
35
+ with:
36
+ token: ${{ secrets.NPM_TOKEN }}
37
+
38
+ - name: Read Changelog
39
+ id: changelog
40
+ run: echo "::set-output name=body::$(cat CHANGELOG.md)"
41
+
42
+ - name: Get package.json version
43
+ id: package_version
44
+ run: echo "::set-output name=version::$(node -p "require('./package.json').version")"
45
+ shell: bash
46
+
47
+ - name: Set the version in the env
48
+ run: echo "VERSION=${{ steps.package_version.outputs.version }}" >> $GITHUB_ENV
49
+
50
+ - name: Create release
51
+ env:
52
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53
+ run: |
54
+ gh release create "$VERSION" \
55
+ --repo="$GITHUB_REPOSITORY" \
56
+ --title="${GITHUB_REPOSITORY#*/} ${VERSION#v}" \
57
+ --generate-notes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hvedinich/utils",
3
- "version": "0.0.58",
3
+ "version": "0.0.60",
4
4
  "description": "utils module",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,6 +1,8 @@
1
1
  module.exports = (env, def, int) => {
2
2
  const curEnv = process.env[env];
3
3
  if (curEnv) {
4
+ if (curEnv === 'false') return false;
5
+ if (curEnv === 'true') return true;
4
6
  if (int) return parseInt(curEnv, 10);
5
7
  return curEnv;
6
8
  }