ci: improve version file and tarball creation (#301)

This commit is contained in:
Robert Kaussow 2022-08-30 21:20:49 +02:00 committed by GitHub
parent 0345c47b7c
commit 6f0f82757a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 96 additions and 4 deletions

View File

@ -102,17 +102,21 @@ steps:
- name: assets
image: node:lts
commands:
- git fetch -tq
- npm install > /dev/null
- npm run build
- cat VERSION
environment:
FORCE_COLOR: true
NPM_CONFIG_LOGLEVEL: error
- name: package
image: thegeeklab/alpine-tools
image: node:lts
commands:
- echo "${DRONE_TAG:-latest}" > VERSION
- tar -zcvf dist/hugo-geekblog.tar.gz -X .tarignore .
- npm run pack
environment:
FORCE_COLOR: true
NPM_CONFIG_LOGLEVEL: error
- name: checksum
image: thegeeklab/alpine-tools
@ -283,6 +287,6 @@ depends_on:
---
kind: signature
hmac: edaa3b55fd0fa9e3ee94e26ec12386e405da77c12f648862d8cdf5a86ece2adf
hmac: a3c1af6ac4b291e8aa1e7f9cbccb1a7c7edbf75163a36ed811c0694227a4f792
...

1
.gitignore vendored
View File

@ -17,6 +17,7 @@ CHANGELOG.md
/resources/
/exampleSite/resources/
/exampleSite/data/sprites/
VERSION
# testing
.lighthouseci/

View File

@ -24,6 +24,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://hugo-geekblog.geekdocs.de/posts/usage/getting-started/) for details about the different setup options.

View File

@ -46,6 +46,9 @@ npm install
# run the build script to build required assets
npm run build
# build release tarball
npm run pack
```
## Using the theme

74
package-lock.json generated
View File

@ -16,6 +16,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",
@ -441,6 +442,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",
@ -9700,6 +9738,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",
@ -12953,6 +12997,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",
@ -20172,6 +20240,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",

View File

@ -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",
@ -37,6 +38,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",

View File

@ -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")
@ -97,6 +98,10 @@ var config = {
new SRIPlugin({
sourceFile: "data/assets.json"
}),
new GitVersionPlugin({
path: "../VERSION"
})
]
}