Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/thegeeklab/hugo-geekdoc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Kaussow <mail@thegeeklab.de>2022-08-29 23:53:07 +0300
committerGitHub <noreply@github.com>2022-08-29 23:53:07 +0300
commite7c4453d45c6e7c2b573c982a6af0629c7eb8831 (patch)
tree950b77f75370ab2f1e7a4d1c7da872e7c1d7e53f
parent12c81554ac8949c2e6aba96836141adf826a8c44 (diff)
ci: improve version file and tarball creation (#486)
-rw-r--r--.drone.yml12
-rw-r--r--.gitignore1
-rw-r--r--README.md3
-rw-r--r--exampleSite/content/en/usage/getting-started.md3
-rw-r--r--package-lock.json74
-rw-r--r--package.json2
-rw-r--r--webpack.config.js5
7 files changed, 96 insertions, 4 deletions
diff --git a/.drone.yml b/.drone.yml
index 5371211..692783a 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -109,10 +109,14 @@ steps:
NPM_CONFIG_LOGLEVEL: error
- name: package
- image: thegeeklab/alpine-tools
+ image: node:lts
commands:
- - echo "${DRONE_TAG:-latest}" > VERSION
- - tar -zcvf dist/hugo-geekdoc.tar.gz -X .tarignore .
+ - npm install > /dev/null
+ - npm run pack
+ - cat VERSION
+ environment:
+ FORCE_COLOR: true
+ NPM_CONFIG_LOGLEVEL: error
- name: checksum
image: thegeeklab/alpine-tools
@@ -282,6 +286,6 @@ depends_on:
---
kind: signature
-hmac: 174ee9580389384095c11bf1d67c9093de21ee35c1fb0873ee2e9c8925f5545c
+hmac: eb26add9335c7c40ec3cea16d63c67a0b3edc6759749f5aec4458ed3ceb62dd6
...
diff --git a/.gitignore b/.gitignore
index f36f822..1680e1e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,6 +21,7 @@ exampleSite/content/de
/resources/
/exampleSite/resources/
/exampleSite/data/sprites/
+VERSION
# hugo
.hugo_build.lock
diff --git a/README.md b/README.md
index 45691ef..8ab84a8 100644
--- a/README.md
+++ b/README.md
@@ -22,6 +22,9 @@ npm install
# run the build script to build required assets
npm run build
+
+# build release tarball
+npm run pack
```
See the [Getting Started Guide](https://geekdocs.de/usage/getting-started/) for details about the different setup options.
diff --git a/exampleSite/content/en/usage/getting-started.md b/exampleSite/content/en/usage/getting-started.md
index ab45758..ff6ea17 100644
--- a/exampleSite/content/en/usage/getting-started.md
+++ b/exampleSite/content/en/usage/getting-started.md
@@ -21,6 +21,9 @@ npm install
# run the build script to build required assets
npm run build
+
+# build release tarball
+npm run pack
```
## Using the theme
diff --git a/package-lock.json b/package-lock.json
index ce33934..2103f20 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -18,6 +18,7 @@
},
"devDependencies": {
"@babel/eslint-parser": "7.18.9",
+ "@eloquent/git-version-webpack-plugin": "^5.0.1",
"autoprefixer": "10.4.8",
"copy-webpack-plugin": "11.0.0",
"css-loader": "6.7.1",
@@ -448,6 +449,43 @@
"node": ">=10.0.0"
}
},
+ "node_modules/@eloquent/git-version-webpack-plugin": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/@eloquent/git-version-webpack-plugin/-/git-version-webpack-plugin-5.0.1.tgz",
+ "integrity": "sha512-p445+YEiw6U8nfaiPe3e+HhMGVdlW3q3YraD22N2oI1ldVLF9UOVHJcWWs3Nqg2JQKCNHXa4vnb6mTgEDoclSQ==",
+ "dev": true,
+ "dependencies": {
+ "safe-require": "^1.0.3",
+ "schema-utils": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "optionalDependencies": {
+ "html-webpack-plugin": "^5.3.1"
+ },
+ "peerDependencies": {
+ "webpack": "^5.34.0"
+ }
+ },
+ "node_modules/@eloquent/git-version-webpack-plugin/node_modules/schema-utils": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz",
+ "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==",
+ "dev": true,
+ "dependencies": {
+ "@types/json-schema": "^7.0.8",
+ "ajv": "^6.12.5",
+ "ajv-keywords": "^3.5.2"
+ },
+ "engines": {
+ "node": ">= 10.13.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/webpack"
+ }
+ },
"node_modules/@eslint/eslintrc": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.1.tgz",
@@ -9712,6 +9750,12 @@
"ret": "~0.1.10"
}
},
+ "node_modules/safe-require": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/safe-require/-/safe-require-1.0.4.tgz",
+ "integrity": "sha512-1elAbSH1u7HVMfbuqktLWAN0wMOeT+FnJVqMhBgEJLvL95m+KT433tiJdGMV1e3TstQXRt1YrKQDRBu0Kpk4WA==",
+ "dev": true
+ },
"node_modules/safe-stable-stringify": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.3.1.tgz",
@@ -12970,6 +13014,30 @@
"integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==",
"dev": true
},
+ "@eloquent/git-version-webpack-plugin": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/@eloquent/git-version-webpack-plugin/-/git-version-webpack-plugin-5.0.1.tgz",
+ "integrity": "sha512-p445+YEiw6U8nfaiPe3e+HhMGVdlW3q3YraD22N2oI1ldVLF9UOVHJcWWs3Nqg2JQKCNHXa4vnb6mTgEDoclSQ==",
+ "dev": true,
+ "requires": {
+ "html-webpack-plugin": "^5.3.1",
+ "safe-require": "^1.0.3",
+ "schema-utils": "^3.0.0"
+ },
+ "dependencies": {
+ "schema-utils": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz",
+ "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==",
+ "dev": true,
+ "requires": {
+ "@types/json-schema": "^7.0.8",
+ "ajv": "^6.12.5",
+ "ajv-keywords": "^3.5.2"
+ }
+ }
+ }
+ },
"@eslint/eslintrc": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.1.tgz",
@@ -20194,6 +20262,12 @@
"ret": "~0.1.10"
}
},
+ "safe-require": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/safe-require/-/safe-require-1.0.4.tgz",
+ "integrity": "sha512-1elAbSH1u7HVMfbuqktLWAN0wMOeT+FnJVqMhBgEJLvL95m+KT433tiJdGMV1e3TstQXRt1YrKQDRBu0Kpk4WA==",
+ "dev": true
+ },
"safe-stable-stringify": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.3.1.tgz",
diff --git a/package.json b/package.json
index 7ed70d3..e39bf22 100644
--- a/package.json
+++ b/package.json
@@ -7,6 +7,7 @@
"build": "run-s prep:clean prep:make svg build:webpack",
"build:webpack": "webpack --mode=production",
"build:webpack-devel": "webpack --mode=development",
+ "pack": "tar -zcvf dist/hugo-geekdoc.tar.gz -X .tarignore .",
"start": "run-s prep:clean prep:make svg build:webpack-devel ; run-p start:webpack start:hugo",
"start:webpack": "webpack --mode=development --watch",
"start:build": "webpack --mode=development",
@@ -39,6 +40,7 @@
},
"devDependencies": {
"@babel/eslint-parser": "7.18.9",
+ "@eloquent/git-version-webpack-plugin": "^5.0.1",
"autoprefixer": "10.4.8",
"copy-webpack-plugin": "11.0.0",
"css-loader": "6.7.1",
diff --git a/webpack.config.js b/webpack.config.js
index f0064be..56a74cc 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -2,6 +2,7 @@ const path = require("path")
const glob = require("glob")
const { WebpackManifestPlugin } = require("webpack-manifest-plugin")
+const GitVersionPlugin = require("@eloquent/git-version-webpack-plugin")
const FaviconsWebpackPlugin = require("favicons-webpack-plugin")
const RemoveEmptyScriptsPlugin = require("webpack-remove-empty-scripts")
const CopyPlugin = require("copy-webpack-plugin")
@@ -98,6 +99,10 @@ var config = {
new SRIPlugin({
sourceFile: "data/assets.json"
+ }),
+
+ new GitVersionPlugin({
+ path: "../VERSION"
})
]
}