Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

chore: update build #229

Merged
merged 1 commit into from
Jan 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
172 changes: 13 additions & 159 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,7 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: lts/*
- uses: actions/cache@v2
id: cache
env:
CACHE_NAME: cache-node-modules
with:
path: |
~/.npm
./dist
./node_modules
./packages/*/dist
./packages/*/node_modules
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.sha }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install
npm run --if-present build
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run --if-present lint
- run: npm run --if-present dep-check

Expand All @@ -49,23 +33,7 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- uses: actions/cache@v2
id: cache
env:
CACHE_NAME: cache-node-modules
with:
path: |
~/.npm
./dist
./node_modules
./packages/*/dist
./packages/*/node_modules
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.sha }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install
npm run --if-present build
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run --if-present test:node
- uses: codecov/codecov-action@v1

Expand All @@ -77,23 +45,7 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: lts/*
- uses: actions/cache@v2
id: cache
env:
CACHE_NAME: cache-node-modules
with:
path: |
~/.npm
./dist
./node_modules
./packages/*/dist
./packages/*/node_modules
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.sha }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install
npm run --if-present build
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run --if-present test:chrome

test-chrome-webworker:
Expand All @@ -104,23 +56,7 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: lts/*
- uses: actions/cache@v2
id: cache
env:
CACHE_NAME: cache-node-modules
with:
path: |
~/.npm
./dist
./node_modules
./packages/*/dist
./packages/*/node_modules
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.sha }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install
npm run --if-present build
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run --if-present test:chrome-webworker

test-firefox:
Expand All @@ -131,23 +67,7 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: lts/*
- uses: actions/cache@v2
id: cache
env:
CACHE_NAME: cache-node-modules
with:
path: |
~/.npm
./dist
./node_modules
./packages/*/dist
./packages/*/node_modules
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.sha }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install
npm run --if-present build
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run --if-present test:firefox

test-firefox-webworker:
Expand All @@ -158,23 +78,7 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: lts/*
- uses: actions/cache@v2
id: cache
env:
CACHE_NAME: cache-node-modules
with:
path: |
~/.npm
./dist
./node_modules
./packages/*/dist
./packages/*/node_modules
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.sha }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install
npm run --if-present build
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run --if-present test:firefox-webworker

test-electron-main:
Expand All @@ -185,23 +89,7 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: lts/*
- uses: actions/cache@v2
id: cache
env:
CACHE_NAME: cache-node-modules
with:
path: |
~/.npm
./dist
./node_modules
./packages/*/dist
./packages/*/node_modules
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.sha }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install
npm run --if-present build
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npx xvfb-maybe npm run --if-present test:electron-main

test-electron-renderer:
Expand All @@ -212,23 +100,7 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: lts/*
- uses: actions/cache@v2
id: cache
env:
CACHE_NAME: cache-node-modules
with:
path: |
~/.npm
./dist
./node_modules
./packages/*/dist
./packages/*/node_modules
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.sha }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install
npm run --if-present build
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npx xvfb-maybe npm run --if-present test:electron-renderer

release:
Expand All @@ -242,30 +114,12 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: lts/*
- uses: actions/cache@v2
id: cache
env:
CACHE_NAME: cache-node-modules
- uses: ipfs/aegir/actions/cache-node-modules@master
- uses: ipfs/aegir/actions/docker-login@master
with:
path: |
~/.npm
./dist
./node_modules
./packages/*/dist
./packages/*/node_modules
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.sha }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install
npm run --if-present build
- run: |
if [[ -n "${DOCKER_TOKEN}" ]] && [[ -n "${DOCKER_USERNAME}" ]]; then
echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USERNAME" --password-stdin
fi
npm run --if-present release
docker-token: ${{ secrets.DOCKER_USERNAME }}
docker-username: ${{ secrets.DOCKER_USERNAME }}
- run: npm run --if-present release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}