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 - job: build
displayName: 'Build' displayName: 'Build'
dependsOn: lint
condition: succeeded()
pool: pool:
vmImage: 'ubuntu-latest' vmImage: 'ubuntu-latest'
strategy: strategy:
matrix: matrix:
bundle: Development:
BuildConfiguration: Bundle BuildConfiguration: development
standalone: Production:
BuildConfiguration: Standalone BuildConfiguration: production
maxParallel: 2 Standalone:
BuildConfiguration: standalone
maxParallel: 3
steps: steps:
- task: NodeTool@0 - task: NodeTool@0
@ -36,24 +35,42 @@ jobs:
inputs: inputs:
versionSpec: '10.x' versionSpec: '10.x'
- script: 'yarn install' - task: Cache@2
displayName: 'Install Dependencies' displayName: 'Check Cache'
inputs:
key: 'yarn | yarn.lock'
path: 'node_modules'
cacheHitVar: CACHE_RESTORED
- script: 'yarn build' - script: 'yarn install --frozen-lockfile'
displayName: 'Build' 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' - script: 'test -d dist'
displayName: 'Check Build' displayName: 'Check Build'
- script: 'yarn pack --filename jellyfin-web.tgz' - script: 'mv dist jellyfin-web'
displayName: 'Bundle Release' displayName: 'Rename Directory'
condition: succeeded()
- task: PublishPipelineArtifact@1 - task: PublishPipelineArtifact@1
displayName: 'Publish Release' displayName: 'Publish Release'
condition: succeeded() condition: succeeded()
inputs: inputs:
targetPath: '$(Build.SourcesDirectory)/jellyfin-web.tgz' targetPath: '$(Build.SourcesDirectory)/jellyfin-web'
artifactName: 'jellyfin-web' artifactName: 'jellyfin-web-$(BuildConfiguration)'
- job: lint - job: lint
displayName: 'Lint' displayName: 'Lint'
@ -67,8 +84,16 @@ jobs:
inputs: inputs:
versionSpec: '10.x' 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' displayName: 'Install Dependencies'
condition: ne(variables.CACHE_RESTORED, 'true')
- script: 'yarn run lint' - script: 'yarn run lint'
displayName: 'Run ESLint' 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 ### Getting Started
1. Clone or download this repository. 1. Clone or download this repository.
```sh ```sh
git clone https://github.com/jellyfin/jellyfin-web.git git clone https://github.com/jellyfin/jellyfin-web.git
cd jellyfin-web cd jellyfin-web
``` ```
2. Install build dependencies in the project directory. 2. Install build dependencies in the project directory.
```sh ```sh
yarn install yarn install
``` ```
3. Run the web client with webpack for local development. 3. Run the web client with webpack for local development.
```sh ```sh
yarn serve yarn serve
``` ```
4. Build the client with sourcemaps. 4. Build the client with sourcemaps.
'''sh
yarn ```sh
''' yarn build:development
Or without sourcemaps ```
'''sh
yarn --production 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 imagemin = require('gulp-imagemin');
const sourcemaps = require('gulp-sourcemaps'); const sourcemaps = require('gulp-sourcemaps');
const mode = require('gulp-mode')({ const mode = require('gulp-mode')({
modes: ["development", "bundle", "standalone"], modes: ["development", "production"],
default: "development", default: "development",
verbose: false verbose: false
}); });
@ -22,7 +22,7 @@ const sass = require('gulp-sass');
sass.compiler = require('node-sass') sass.compiler = require('node-sass')
if (mode.bundle() || mode.standalone()) { if (mode.production()) {
var config = require('./webpack.prod.js'); var config = require('./webpack.prod.js');
} else { } else {
var config = require('./webpack.dev.js'); var config = require('./webpack.dev.js');
@ -91,15 +91,14 @@ function css() {
function html() { function html() {
return src(['src/**/*.html', '!src/index.html'], { base: './src/' }) return src(['src/**/*.html', '!src/index.html'], { base: './src/' })
.pipe(mode.bundle(htmlmin({ collapseWhitespace: true }))) .pipe(mode.production(htmlmin({ collapseWhitespace: true })))
.pipe(mode.standalone(htmlmin({ collapseWhitespace: true })))
.pipe(dest('dist/')) .pipe(dest('dist/'))
.pipe(browserSync.stream()); .pipe(browserSync.stream());
} }
function images() { function images() {
return src(['src/**/*.png', 'src/**/*.jpg', 'src/**/*.gif', 'src/**/*.svg'], { base: './src/' }) return src(['src/**/*.png', 'src/**/*.jpg', 'src/**/*.gif', 'src/**/*.svg'], { base: './src/' })
.pipe(imagemin()) .pipe(mode.production(imagemin()))
.pipe(dest('dist/')) .pipe(dest('dist/'))
.pipe(browserSync.stream()); .pipe(browserSync.stream());
} }
@ -120,4 +119,5 @@ function injectBundle() {
} }
exports.default = series(clean, parallel(javascript, webpack, css, html, images, copy), 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": { "scripts": {
"serve": "gulp serve", "serve": "gulp serve",
"build": "gulp --bundle", "prepare": "gulp --production",
"build standalone": "gulp --standalone", "build:development": "gulp --development",
"build development": "gulp", "build:production": "gulp --production",
"build:standalone": "gulp standalone --development",
"lint": "eslint \"src\"", "lint": "eslint \"src\"",
"stylelint": "stylelint \"src/**/*.css\"" "stylelint": "stylelint \"src/**/*.css\""
} }