@skriptfabrik/json-schema-bundler 0.1.0 → 0.1.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.
@@ -30,11 +30,23 @@ jobs:
30
30
  node-version: ${{ env.NODE_VERSION }}
31
31
 
32
32
  - name: Install dependencies
33
- run: npm ci
33
+ run: |-
34
+ npm ci
35
+
36
+ - name: Export short SHA
37
+ run: |-
38
+ echo "GITHUB_SHORT_SHA=$(echo $GITHUB_SHA | cut -c1-8)" >> ${GITHUB_ENV}
34
39
 
35
- - name: Bump package version
40
+ - name: Set package version
41
+ if: github.ref_name == 'main'
42
+ run: |-
43
+ PACKAGE_VERSION=$(jq -r .version package.json)
44
+ npm version "${PACKAGE_VERSION%-*}-${GITHUB_SHORT_SHA}" --no-git-tag-version
45
+
46
+ - name: Set package version from Git
36
47
  if: github.ref_type == 'tag'
37
- run: npm version from-git --no-git-tag-version
48
+ run: |-
49
+ npm version from-git --no-git-tag-version
38
50
 
39
51
  - name: Publish package
40
52
  uses: JS-DevTools/npm-publish@v1
@@ -61,7 +73,9 @@ jobs:
61
73
  with:
62
74
  build-args: |-
63
75
  BUILDKIT_INLINE_CACHE=${{ env.DOCKER_BUILDKIT_INLINE_CACHE }}
76
+ JSON_SCHEMA_BUNDLER_VERSION=${{ env.GITHUB_SHORT_SHA }}
64
77
  cache-from: type=registry,ref=${{ env.DOCKER_IMAGE_NAME }}:latest
78
+ context: .
65
79
  platforms: |-
66
80
  linux/amd64
67
81
  linux/arm64
@@ -83,6 +97,7 @@ jobs:
83
97
  BUILDKIT_INLINE_CACHE=${{ env.DOCKER_BUILDKIT_INLINE_CACHE }}
84
98
  JSON_SCHEMA_BUNDLER_VERSION=v${{ env.RELEASE_VERSION }}
85
99
  cache-from: type=registry,ref=${{ env.DOCKER_IMAGE_NAME }}:latest
100
+ context: .
86
101
  platforms: |-
87
102
  linux/amd64
88
103
  linux/arm64
package/Dockerfile CHANGED
@@ -4,7 +4,6 @@ LABEL maintainer="Daniel Schröder <daniel.schroeder@skriptfabrik.com>"
4
4
 
5
5
  ARG JSON_SCHEMA_BUNDLER_VERSION=latest
6
6
 
7
- ENV JSON_SCHEMA_BUNDLER_VERSION=${JSON_SCHEMA_BUNDLER_VERSION}
8
7
  ENV NODE_ENV=production
9
8
 
10
9
  COPY . /opt/json-schema-bundler-${JSON_SCHEMA_BUNDLER_VERSION}
@@ -3,6 +3,7 @@
3
3
  const $RefParser = require('json-schema-ref-parser');
4
4
  const minimist = require('minimist');
5
5
  const path = require('path');
6
+ const pkg = require('./package.json');
6
7
 
7
8
  const argv = minimist(process.argv.slice(2), {
8
9
  boolean: ['h', 'p', 's'],
@@ -23,7 +24,7 @@ const colors = {
23
24
  if (argv.h || argv._.length < 1) {
24
25
  console.error(
25
26
  `JSON Schema Bundler (%s)\n\n${colors.yellow}Usage:${colors.end}\n %s\n\n${colors.yellow}Arguments:${colors.end}\n %s\n\n${colors.yellow}Options:${colors.end}\n %s\n\n${colors.yellow}Examples:${colors.end}\n %s`,
26
- process.env['JSON_SCHEMA_BUNDLER_VERSION'],
27
+ pkg.version,
27
28
  `${path.basename(process.argv[1])} [options] <input>`,
28
29
  `${colors.green}input${colors.end} The path or URL of the input schema file`,
29
30
  [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skriptfabrik/json-schema-bundler",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "The missing CLI for the JSON Schema $Ref Parser",
5
5
  "keywords": [
6
6
  "json",