Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: improve version file and tarball creation #301

Merged
merged 2 commits into from
Aug 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -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 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@ CHANGELOG.md
/resources/
/exampleSite/resources/
/exampleSite/data/sprites/
VERSION

# testing
.lighthouseci/
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
3 changes: 3 additions & 0 deletions exampleSite/content/posts/usage/getting-started.md
Original file line number Diff line number Diff line change
@@ -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 changes: 74 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
5 changes: 5 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -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"
})
]
}