adapt CI to include man file

This commit is contained in:
Abraham Toriz 2022-09-20 10:43:43 -04:00
parent 0bd576523b
commit 78abfa16e6
No known key found for this signature in database
GPG Key ID: D5B4A746DB5DD42A
5 changed files with 39 additions and 11 deletions

View File

@ -14,6 +14,24 @@ test:cargo:
- cargo clippy --all-targets --all-features -- -D warnings
- cargo test
build-doc:
stage: build
image: python:3.10
script:
- pip install sphinx
- cd docs/
- make html
- make man
- gzip build/man/tiempo.1
rules:
- if: $CI_COMMIT_BRANCH
when: never
- if: $CI_COMMIT_TAG =~ /^v*/
artifacts:
paths:
- docs/build/html
- docs/build/man/tiempo.1.gz
build:
stage: build
image: categulario/rust-cli-image:latest
@ -21,12 +39,14 @@ build:
# build the binary
- cargo build --locked --release
# create the tar package
- mkdir -p build
- mkdir -p build/bin build/doc/man
# move things to the build directory
- cp target/release/t build/t
- cp CHANGELOG.md build/CHANGELOG.md
- cp README.md build/README.md
- cp LICENSE build/LICENSE
- cp target/release/t build/bin/
- cp CHANGELOG.md build/doc/
- cp README.md build/doc/
- cp LICENSE build/doc/
- cp -R docs/build/html build/doc/
- cp docs/build/man/tiempo.1.gz build/doc/man/
# compress the tar file
- tar -cvzf tiempo-${CI_COMMIT_TAG:1}-x86_64.tar.gz build/
# makes the debian archive

View File

@ -1,2 +1,3 @@
sphinx
tomlkit
furo

View File

@ -8,6 +8,7 @@
from pathlib import Path
from tomlkit import parse
# Make the Cargo.toml file the only source for 'version'
_cargo_toml = Path(__file__).resolve().parent.parent.parent / 'Cargo.toml'
project = 'Tiempo'
@ -28,5 +29,5 @@ exclude_patterns = []
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
html_theme = 'alabaster'
html_theme = 'furo'
html_static_path = ['_static']

View File

@ -33,11 +33,12 @@ sha256sums=('$SUM')
package() {
cd \"\$srcdir/build\"
install -Dm755 $PROJECT_BINARY \"\$pkgdir\"/usr/bin/$PROJECT_BINARY
install -Dm755 bin/$PROJECT_BINARY \"\$pkgdir\"/usr/bin/$PROJECT_BINARY
install -Dm644 README.md \"\$pkgdir\"/usr/share/doc/$PROJECT_NAME/README.md
install -Dm644 LICENSE \"\$pkgdir\"/usr/share/doc/$PROJECT_NAME/LICENSE
install -Dm644 CHANGELOG.md \"\$pkgdir\"/usr/share/doc/$PROJECT_NAME/CHANGELOG.md
install -Dm644 doc/README.md \"\$pkgdir\"/usr/share/doc/$PROJECT_NAME/README.md
install -Dm644 doc/LICENSE \"\$pkgdir\"/usr/share/doc/$PROJECT_NAME/LICENSE
install -Dm644 doc/CHANGELOG.md \"\$pkgdir\"/usr/share/doc/$PROJECT_NAME/CHANGELOG.md
install -Dm644 doc/man/$PROJECT_NAME.1.gz \"\$pkgdir\"/usr/share/man/man1/$PROJECT_NAME.1.gz
}
" | tee PKGBUILD > /dev/null

View File

@ -21,7 +21,7 @@ url='https://gitlab.com/categulario/tiempo-rs'
license=('GPL3')
depends=()
optdepends=('sqlite: for manually editing the database')
makedepends=('cargo' 'git')
makedepends=('cargo' 'git' 'python-sphinx' 'gzip' 'make')
provides=('$PROJECT_NAME')
conflicts=('$PROJECT_NAME')
source=('$PROJECT_NAME-git::git+https://gitlab.com/categulario/tiempo-rs')
@ -35,6 +35,9 @@ pkgver() {
build() {
cd \"\$pkgname\"
cargo build --release --locked
cd docs
make man
gzip build/man/$PROJECT_NAME.1
}
package() {
@ -44,6 +47,8 @@ package() {
install -Dm644 README.md \"\$pkgdir\"/usr/share/doc/$PROJECT_NAME/README.md
install -Dm644 LICENSE \"\$pkgdir\"/usr/share/doc/$PROJECT_NAME/LICENSE
install -Dm644 CHANGELOG.md \"\$pkgdir\"/usr/share/doc/$PROJECT_NAME/CHANGELOG.md
install -Dm644 docs/build/man/$PROJECT_NAME.1.gz \"\$pkgdir\"/usr/share/man/man1/$PROJECT_NAME.1.gz
}" | tee PKGBUILD > /dev/null
makepkg --printsrcinfo > .SRCINFO