2020-11-06 14:40:23 +00:00
|
|
|
name: Build
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths:
|
|
|
|
- "**/*.js"
|
|
|
|
- "**/*.vue"
|
|
|
|
- "public/**/*"
|
|
|
|
- "package-lock.json"
|
|
|
|
- "package.json"
|
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
|
|
|
types: [ opened, synchronize, reopened ]
|
|
|
|
paths:
|
|
|
|
- "**/*.js"
|
|
|
|
- "**/*.vue"
|
|
|
|
- "public/**/*"
|
|
|
|
- "package-lock.json"
|
|
|
|
- "package.json"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
build: [ legacy, modern ]
|
|
|
|
include:
|
|
|
|
- build: legacy
|
2021-02-07 17:47:31 +00:00
|
|
|
BUILD_ARGS: ""
|
|
|
|
BUILD_EXTENSION: true
|
2020-11-06 14:40:23 +00:00
|
|
|
- build: modern
|
|
|
|
BUILD_ARGS: "-- --modern"
|
2021-02-07 17:47:31 +00:00
|
|
|
BUILD_EXTENSION: false
|
2020-11-06 14:40:23 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Use Node.js 14.x
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 14.x
|
|
|
|
|
|
|
|
- name: Get npm cache directory
|
|
|
|
id: npm-cache
|
|
|
|
run: echo "::set-output name=dir::$(npm config get cache)"
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ${{ steps.npm-cache.outputs.dir }}
|
|
|
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
|
|
|
restore-keys: ${{ runner.os }}-node-
|
|
|
|
|
|
|
|
- name: Install Dependencies
|
|
|
|
run: |
|
|
|
|
npm ci
|
|
|
|
npm run fix-compatibility
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
env:
|
|
|
|
GZIP: "--best"
|
|
|
|
run: |
|
|
|
|
npm run build ${{ matrix.BUILD_ARGS }}
|
|
|
|
tar -czvf dist.tar.gz -C ./dist .
|
|
|
|
|
2021-02-07 17:47:31 +00:00
|
|
|
- name: Build Extension
|
|
|
|
if: ${{ matrix.BUILD_EXTENSION }}
|
|
|
|
run: |
|
|
|
|
npm run make-extension
|
2021-02-07 20:24:55 +00:00
|
|
|
cd dist
|
|
|
|
zip -rJ9 ../extension.zip *
|
|
|
|
cd ..
|
2021-02-07 17:47:31 +00:00
|
|
|
|
2020-11-06 14:40:23 +00:00
|
|
|
- name: Publish artifact
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: unlock-music-${{ matrix.build }}.tar.gz
|
|
|
|
path: ./dist.tar.gz
|
2021-02-07 17:47:31 +00:00
|
|
|
|
|
|
|
- name: Publish artifact - Extension
|
|
|
|
if: ${{ matrix.BUILD_EXTENSION }}
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: extension.zip
|
|
|
|
path: ./extension.zip
|