diff --git a/.drone.yml b/.drone.yml index 9c5f415..2449609 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,7 +2,25 @@ workspace: path: src pipeline: - downstream: + build: + image: library/node:latest + commands: + - npm install -q + - npm run clean + - npm run build + - npm run release + + release: + image: plugins/s3 + path_style: true + strip_prefix: dist/ + source: dist/master.tar.gz + target: /theme + when: + event: [ push ] + branch: [ master ] + + trigger: image: plugins/downstream server: https://drone.gitea.io repositories: @@ -11,8 +29,8 @@ pipeline: - go-gitea/docs - go-gitea/redirects when: - event: push - branch: master + event: [ push ] + branch: [ master ] gitter: image: plugins/gitter diff --git a/.drone.yml.sig b/.drone.yml.sig index 279006e..c146448 100644 --- a/.drone.yml.sig +++ b/.drone.yml.sig @@ -1 +1 @@ -eyJhbGciOiJIUzI1NiJ9.d29ya3NwYWNlOgogIHBhdGg6IHNyYwoKcGlwZWxpbmU6CiAgZG93bnN0cmVhbToKICAgIGltYWdlOiBwbHVnaW5zL2Rvd25zdHJlYW0KICAgIHNlcnZlcjogaHR0cHM6Ly9kcm9uZS5naXRlYS5pbwogICAgcmVwb3NpdG9yaWVzOgogICAgICAtIGdvLWdpdGVhL3dlYnNpdGUKICAgICAgLSBnby1naXRlYS9ibG9nCiAgICAgIC0gZ28tZ2l0ZWEvZG9jcwogICAgICAtIGdvLWdpdGVhL3JlZGlyZWN0cwogICAgd2hlbjoKICAgICAgZXZlbnQ6IHB1c2gKICAgICAgYnJhbmNoOiBtYXN0ZXIKCiAgZ2l0dGVyOgogICAgaW1hZ2U6IHBsdWdpbnMvZ2l0dGVyCg.lHRIDpUb3xcDLTmMupUq1uSU7XR47kKiAOsOlYw57BM \ No newline at end of file +eyJhbGciOiJIUzI1NiJ9.d29ya3NwYWNlOgogIHBhdGg6IHNyYwoKcGlwZWxpbmU6CiAgYnVpbGQ6CiAgICBpbWFnZTogbGlicmFyeS9ub2RlOmxhdGVzdAogICAgY29tbWFuZHM6CiAgICAgIC0gbnBtIGluc3RhbGwgLXEKICAgICAgLSBucG0gcnVuIGNsZWFuCiAgICAgIC0gbnBtIHJ1biBidWlsZAogICAgICAtIG5wbSBydW4gcmVsZWFzZQoKICByZWxlYXNlOgogICAgaW1hZ2U6IHBsdWdpbnMvczMKICAgIHBhdGhfc3R5bGU6IHRydWUKICAgIHN0cmlwX3ByZWZpeDogZGlzdC8KICAgIHNvdXJjZTogZGlzdC9tYXN0ZXIudGFyLmd6CiAgICB0YXJnZXQ6IC90aGVtZQogICAgd2hlbjoKICAgICAgZXZlbnQ6IFsgcHVzaCBdCiAgICAgIGJyYW5jaDogWyBtYXN0ZXIgXQoKICB0cmlnZ2VyOgogICAgaW1hZ2U6IHBsdWdpbnMvZG93bnN0cmVhbQogICAgc2VydmVyOiBodHRwczovL2Ryb25lLmdpdGVhLmlvCiAgICByZXBvc2l0b3JpZXM6CiAgICAgIC0gZ28tZ2l0ZWEvd2Vic2l0ZQogICAgICAtIGdvLWdpdGVhL2Jsb2cKICAgICAgLSBnby1naXRlYS9kb2NzCiAgICAgIC0gZ28tZ2l0ZWEvcmVkaXJlY3RzCiAgICB3aGVuOgogICAgICBldmVudDogWyBwdXNoIF0KICAgICAgYnJhbmNoOiBbIG1hc3RlciBdCgogIGdpdHRlcjoKICAgIGltYWdlOiBwbHVnaW5zL2dpdHRlcgo.N2Jze2NItEHFkItBvnoEO6Iw15Ar3kWd2QyJj5wByHo \ No newline at end of file diff --git a/.gitignore b/.gitignore index 066ebdf..c291388 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /node_modules/ +/dist/ /static/styles/ diff --git a/gulpfile.js b/gulpfile.js index fa4d535..6928278 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,8 +1,30 @@ var gulp = require('gulp'); var sass = require('gulp-sass'); var sourcemaps = require('gulp-sourcemaps'); +var tar = require('gulp-tar'); +var gzip = require('gulp-gzip'); +var clean = require('gulp-clean'); -gulp.task('default', ['sass']); +var sources = [ + 'archetypes', + 'i18n', + 'layouts', + 'static', + 'DCO', + 'LICENSE', + 'README.md', + 'theme.toml' +]; + +gulp.task('default', ['build']); +gulp.task('build', ['sass']); + +gulp.task('release', function () { + return gulp.src(sources) + .pipe(tar('master.tar')) + .pipe(gzip()) + .pipe(gulp.dest('dist')) +}); gulp.task('sass', function () { return gulp.src('./src/main.scss') @@ -12,6 +34,11 @@ gulp.task('sass', function () { .pipe(gulp.dest('./static/styles')); }); -gulp.task('watch', function () { - gulp.watch('./src/*.scss', ['sass']); +gulp.task('clean', function () { + return gulp.src(['dist', 'static/styles']) + .pipe(clean()); +}); + +gulp.task('watch', function () { + return gulp.watch('./src/*.scss', ['sass']); }); diff --git a/package.json b/package.json index cff2a65..ab8fb79 100644 --- a/package.json +++ b/package.json @@ -1,22 +1,36 @@ { "name": "gitea-theme", - "description": "This is a Hugo theme that gets used within all of our websites like our blog, documentation and also the redirects.", + "version": "0.0.0", + "description": "A Hugo theme that gets used within all of our websites.", + "homepage": "https://github.com/go-gitea/theme#readme", + "license": "Apache-2.0", + "author": { + "name": "The Gitea Authors", + "email": "team@gitea.io" + }, "repository": { "type": "git", - "url": "git+https://github.com/go-gitea/theme.git" + "url": "https://github.com/go-gitea/theme.git" }, - "author": "The Gitea Authors", - "license": "Apache-2.0", "bugs": { - "url": "https://github.com/go-gitea/theme/issues" + "url": "https://github.com/go-gitea/theme/issues", + "email": "team@gitea.io" + }, + "scripts": { + "clean": "gulp clean", + "build": "gulp build", + "release": "gulp release", + "watch": "gulp watch" }, - "homepage": "https://github.com/go-gitea/theme#readme", "dependencies": { "bootstrap": "^4.0.0-alpha.5" }, "devDependencies": { "gulp": "^3.9.1", + "gulp-clean": "^0.3.2", + "gulp-gzip": "^1.4.0", "gulp-sass": "^2.3.2", - "gulp-sourcemaps": "^1.9.1" + "gulp-sourcemaps": "^1.9.1", + "gulp-tar": "^1.9.0" } }