Merge pull request #953 from dkanada/ci

Remove tar from published artifacts
This commit is contained in:
dkanada 2020-03-18 08:01:58 +09:00 committed by GitHub
commit 1cfad11281
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 66 additions and 33 deletions

View file

@ -16,19 +16,18 @@ jobs:
- job: build
displayName: 'Build'
dependsOn: lint
condition: succeeded()
pool:
vmImage: 'ubuntu-latest'
strategy:
matrix:
bundle:
BuildConfiguration: Bundle
standalone:
BuildConfiguration: Standalone
maxParallel: 2
Development:
BuildConfiguration: development
Production:
BuildConfiguration: production
Standalone:
BuildConfiguration: standalone
maxParallel: 3
steps:
- task: NodeTool@0
@ -36,24 +35,42 @@ jobs:
inputs:
versionSpec: '10.x'
- script: 'yarn install'
displayName: 'Install Dependencies'
- task: Cache@2
displayName: 'Check Cache'
inputs:
key: 'yarn | yarn.lock'
path: 'node_modules'
cacheHitVar: CACHE_RESTORED
- script: 'yarn build'
displayName: 'Build'
- script: 'yarn install --frozen-lockfile'
displayName: 'Install Dependencies'
condition: ne(variables.CACHE_RESTORED, 'true')
- script: 'yarn build:development'
displayName: 'Build Development'
condition: eq(variables['BuildConfiguration'], 'development')
- script: 'yarn build:production'
displayName: 'Build Bundle'
condition: eq(variables['BuildConfiguration'], 'production')
- script: 'yarn build:standalone'
displayName: 'Build Standalone'
condition: eq(variables['BuildConfiguration'], 'standalone')
- script: 'test -d dist'
displayName: 'Check Build'
- script: 'yarn pack --filename jellyfin-web.tgz'
displayName: 'Bundle Release'
- script: 'mv dist jellyfin-web'
displayName: 'Rename Directory'
condition: succeeded()
- task: PublishPipelineArtifact@1
displayName: 'Publish Release'
condition: succeeded()
inputs:
targetPath: '$(Build.SourcesDirectory)/jellyfin-web.tgz'
artifactName: 'jellyfin-web'
targetPath: '$(Build.SourcesDirectory)/jellyfin-web'
artifactName: 'jellyfin-web-$(BuildConfiguration)'
- job: lint
displayName: 'Lint'
@ -67,8 +84,16 @@ jobs:
inputs:
versionSpec: '10.x'
- script: 'yarn install'
- task: Cache@2
displayName: 'Check Cache'
inputs:
key: 'yarn | yarn.lock'
path: 'node_modules'
cacheHitVar: CACHE_RESTORED
- script: 'yarn install --frozen-lockfile'
displayName: 'Install Dependencies'
condition: ne(variables.CACHE_RESTORED, 'true')
- script: 'yarn run lint'
displayName: 'Run ESLint'

View file

@ -50,25 +50,32 @@ Jellyfin Web is the frontend used for most of the clients available for end user
### Getting Started
1. Clone or download this repository.
```sh
git clone https://github.com/jellyfin/jellyfin-web.git
cd jellyfin-web
```
2. Install build dependencies in the project directory.
```sh
yarn install
```
3. Run the web client with webpack for local development.
```sh
yarn serve
```
4. Build the client with sourcemaps.
'''sh
yarn
'''
Or without sourcemaps
'''sh
yarn --production
'''
```sh
yarn build:development
```
You can build a nginx compatible version as well.
```sh
yarn build:standalone
```

View file

@ -10,7 +10,7 @@ const htmlmin = require('gulp-htmlmin');
const imagemin = require('gulp-imagemin');
const sourcemaps = require('gulp-sourcemaps');
const mode = require('gulp-mode')({
modes: ["development", "bundle", "standalone"],
modes: ["development", "production"],
default: "development",
verbose: false
});
@ -22,7 +22,7 @@ const sass = require('gulp-sass');
sass.compiler = require('node-sass')
if (mode.bundle() || mode.standalone()) {
if (mode.production()) {
var config = require('./webpack.prod.js');
} else {
var config = require('./webpack.dev.js');
@ -91,15 +91,14 @@ function css() {
function html() {
return src(['src/**/*.html', '!src/index.html'], { base: './src/' })
.pipe(mode.bundle(htmlmin({ collapseWhitespace: true })))
.pipe(mode.standalone(htmlmin({ collapseWhitespace: true })))
.pipe(mode.production(htmlmin({ collapseWhitespace: true })))
.pipe(dest('dist/'))
.pipe(browserSync.stream());
}
function images() {
return src(['src/**/*.png', 'src/**/*.jpg', 'src/**/*.gif', 'src/**/*.svg'], { base: './src/' })
.pipe(imagemin())
.pipe(mode.production(imagemin()))
.pipe(dest('dist/'))
.pipe(browserSync.stream());
}
@ -120,4 +119,5 @@ function injectBundle() {
}
exports.default = series(clean, parallel(javascript, webpack, css, html, images, copy), injectBundle)
exports.serve = series(exports.default, standalone, serve)
exports.standalone = series(exports.default, standalone)
exports.serve = series(exports.standalone, serve)

View file

@ -90,9 +90,10 @@
],
"scripts": {
"serve": "gulp serve",
"build": "gulp --bundle",
"build standalone": "gulp --standalone",
"build development": "gulp",
"prepare": "gulp --production",
"build:development": "gulp --development",
"build:production": "gulp --production",
"build:standalone": "gulp standalone --development",
"lint": "eslint \"src\"",
"stylelint": "stylelint \"src/**/*.css\""
}