1
0
mirror of https://github.com/pavlobu/deskreen.git synced 2025-05-21 01:40:12 -07:00

Merge pull request #29 from pavlobu/fix-build

cache build issues fixed! 🎉
This commit is contained in:
Pavlo Buidenkov 2021-01-20 10:59:18 -08:00 committed by GitHub
commit 39e284e355
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 92 additions and 45 deletions

View File

@ -2,34 +2,52 @@ name: build and test
on: [pull_request] on: [pull_request]
# NPMRC_ADMIN_USER_AUTH_TOKEN
jobs: jobs:
build-and-test: build-and-test:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
matrix: matrix:
os: [macos-10.15, windows-2019, ubuntu-18.04] os: [macos-10.15, windows-2019, ubuntu-18.04] # IMPORTANT!!! here ubuntu-18.04 should be same as in codecov and release workflows, this is for making shure cahes used in most efficient way
steps: steps:
- name: Check out Git repository - name: Check out Git repository
uses: actions/checkout@v2.3.1 uses: actions/checkout@v2.3.4
- name: install yarn dependencies in app/client using cache - name: Setup Node.js environment
uses: bahmutov/npm-install@v1.6.0 uses: actions/setup-node@v2.1.4
with: with:
working-directory: ./app/client node-version: '12'
- name: install yarn dependencies in ./ using cache - name: Get yarn cache directory path
uses: bahmutov/npm-install@v1.6.0 id: yarn-cache-dir-path
with: run: echo "::set-output name=dir::$(yarn cache dir)"
working-directory: ./
- name: install yarn dependencies in ./app using cache - uses: actions/cache@v2.1.3
uses: bahmutov/npm-install@v1.6.0 id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with: with:
working-directory: ./app path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ matrix.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ matrix.os }}-yarn-
- name: yarn install in ./app/client
run: |
cd ./app/client
yarn install
- name: yarn install in ./
run: yarn install
- name: yarn install in ./app
run: |
cd ./app
yarn install
- name: yarn build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: yarn build
# following step does code signing when `electron-builder --publish always` (look in package.json) # following step does code signing when `electron-builder --publish always` (look in package.json)
- name: yarn package-ci - name: yarn package-ci
@ -37,11 +55,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: yarn package-ci run: yarn package-ci
- name: yarn build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: yarn build
- name: yarn lint - name: yarn lint
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,29 +1,48 @@
name: codecov generate name: codecov
on: [pull_request] on: [pull_request]
jobs: jobs:
run: run:
runs-on: ubuntu-18.04 runs-on: ubuntu-18.04 # IMPORTANT!!! this LINUX os should be the same as in build-and-test and release workflows! this is for making shure cahes used in most efficient way
steps: steps:
- name: Check out Git repository - name: Check out Git repository
uses: actions/checkout@v2.3.1 uses: actions/checkout@v2.3.4
- name: install yarn dependencies in app/client using cache - name: Setup Node.js environment
uses: bahmutov/npm-install@v1.6.0 uses: actions/setup-node@v2.1.4
with: with:
working-directory: ./app/client node-version: '12'
- name: install yarn dependencies in ./ using cache - name: Get yarn cache directory path
uses: bahmutov/npm-install@v1.6.0 id: yarn-cache-dir-path
with: run: echo "::set-output name=dir::$(yarn cache dir)"
working-directory: ./
- name: install yarn dependencies in ./app using cache - uses: actions/cache@v2.1.3
uses: bahmutov/npm-install@v1.6.0 id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with: with:
working-directory: ./app path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ubuntu-18.04-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
ubuntu-18.04-yarn-
- name: yarn install in ./app/client
run: |
cd ./app/client
yarn install
- name: yarn install in ./
run: yarn install
- name: yarn install in ./app
run: |
cd ./app
yarn install
- name: yarn build - name: yarn build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: yarn build run: yarn build
- name: yarn test - name: yarn test

View File

@ -30,7 +30,7 @@ jobs:
strategy: strategy:
matrix: matrix:
include: include:
- os: ubuntu-18.04 - os: ubuntu-18.04 # IMPORTANT!!! this LINUX os should be the same as in build-and-test and covecov workflows! this is for making shure cahes used in most efficient way
artifact_name: 'release/{*.AppImage,*.rpm,*.deb,*.yml}' artifact_name: 'release/{*.AppImage,*.rpm,*.deb,*.yml}'
- os: windows-2019 - os: windows-2019
artifact_name: 'release/{*.msi,*.exe,*.blockmap,*.yml}' artifact_name: 'release/{*.msi,*.exe,*.blockmap,*.yml}'
@ -39,22 +39,37 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v2.3.1 uses: actions/checkout@v2.3.4
- name: install yarn dependencies in app/client using cache - name: Setup Node.js environment
uses: bahmutov/npm-install@v1.6.0 uses: actions/setup-node@v2.1.4
with: with:
working-directory: ./app/client node-version: '12'
- name: install yarn dependencies in ./ using cache - name: Get yarn cache directory path
uses: bahmutov/npm-install@v1.6.0 id: yarn-cache-dir-path
with: run: echo "::set-output name=dir::$(yarn cache dir)"
working-directory: ./
- name: install yarn dependencies in ./app using cache - uses: actions/cache@v2.1.3
uses: bahmutov/npm-install@v1.6.0 id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with: with:
working-directory: ./app path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ matrix.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ matrix.os }}-yarn-
- name: yarn install in ./app/client
run: |
cd ./app/client
yarn install
- name: yarn install in ./
run: yarn install
- name: yarn install in ./app
run: |
cd ./app
yarn install
- name: yarn build - name: yarn build
env: env:

View File

@ -4,7 +4,7 @@
"version": "1.0.0", "version": "1.0.0",
"description": "Deskreen makes any device a second screen for your computer", "description": "Deskreen makes any device a second screen for your computer",
"scripts": { "scripts": {
"build": "yarn build-main && yarn build-renderer && yarn build-client", "build": "yarn build-client && yarn build-main && yarn build-renderer",
"build-test": "yarn build-main-test && yarn build-renderer-test && yarn build-client", "build-test": "yarn build-main-test && yarn build-renderer-test && yarn build-client",
"build-dll": "cross-env NODE_ENV=development webpack --config ./configs/webpack.config.renderer.dev.dll.babel.js --colors", "build-dll": "cross-env NODE_ENV=development webpack --config ./configs/webpack.config.renderer.dev.dll.babel.js --colors",
"build-e2e": "cross-env E2E_BUILD=true yarn build", "build-e2e": "cross-env E2E_BUILD=true yarn build",