Skip to content

Commit

Permalink
chore: remove dep hats, bump deps, update readme, rebuild package-lock (
Browse files Browse the repository at this point in the history
#259)

* chore: remove dep hats, bump deps, update readme, rebuild package-lock

* fix: package-lock conflict

* fix: update workflows with new rules for dependency installing

* fix: only install dev dependencies for linting
  • Loading branch information
kambydyne authored Aug 17, 2021
1 parent 828b3cf commit 29ae56f
Show file tree
Hide file tree
Showing 8 changed files with 928 additions and 3,572 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
name: monokle-build-mac-nightly
name: monokle-build-nightly

on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 2 * * *'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
# This workflow contains a single job called "build"
build-mac:
build-nightly-mac:
runs-on: macOS-latest

steps:
Expand All @@ -33,7 +31,7 @@ jobs:
- name: Install Tools
run: |
brew install tree jq
brew install jq
- name: Get Node Version
run: |
Expand All @@ -52,12 +50,12 @@ jobs:
env
echo "npm: $(npm --version)"
echo "node: $(node --version)"
npm install --force
npm install
- name: Verify Dependencies
run: |
ls -la
tree node_modules -L 1
npm list --depth=1
- name: Generate and apply tag
run: |
Expand All @@ -82,7 +80,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.github_token }}

# Check Binary Size
# Check Binary Sizes
- name: Build Succeeded
run: |
ls -alh dist | grep Monokle && du -sh dist/mac || true
Expand All @@ -107,9 +105,87 @@ jobs:
path: /Users/runner/.npm/_logs
if: ${{ failure() || cancelled() }}

# Make sure no secrets or certs are left on the runner
- name: Cleanup files after run
build-nightly-windows:
runs-on: windows-latest

steps:
# Make sure build is clean and no files from a previous run are re-used.
- name: Cleanup files before run
run: |
rm -rf *
ls -la
cmd /r dir
if: ${{ always() }}

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it.
- name: Checkout Project
uses: actions/checkout@v2

- name: Get Node Version
run: |
Set-PSDebug -Trace 1
$filePath = "D:\a\monokle\monokle\.nvmrc"
Get-Content $filePath -Raw
$content = Get-Content $filePath -Raw
echo "::set-output name=nodeversion::$content"
id: get-node-version

- name: Use Node.js ${{ steps.get-node-version.outputs.nodeversion }}
uses: actions/setup-node@v2
with:
node-version: ${{ steps.get-node-version.outputs.nodeversion }}
cache: 'npm'

# Install Dependencies
- name: Install Dependencies
run: |
Set-PSDebug -Trace 1
node --version
npm --version
npm install
- name: Verify Dependencies
run: |
cmd /r dir
npm list --depth=1
- name: Generate and apply tag
run: |
Set-PSDebug -Trace 1
$datetoday = Get-Date -Format "yyyyMMdd"
echo $datetoday
npm --no-git-tag-version --preid=$datetoday version prerelease
npm version
$p = get-content package.json | ConvertFrom-Json
echo $p.version
$ErrorActionPreference = 'SilentlyContinue'
git tag $p.version
git push origin $tag
env:
GITHUB_TOKEN: ${{ secrets.github_token }}

- name: Build
run: |
npm run electron:build:ci
env:
# Set CI flag to false, or the build fails on all warnings, not just errors as locally.
CI: false

- name: Package and Publish
run: |
npm exec -c 'electron-builder --publish "always"'
env:
GITHUB_TOKEN: ${{ secrets.github_token }}

# Check Binary Sizes
- name: Build Succeeded
run: |
cmd /r dir .\dist
if: ${{ success() }}

- name: Build Failed - Archive Build Logs
uses: actions/upload-artifact@v2
with:
name: logs
path: .\msilog.txt
if: ${{ failure() || cancelled() }}
95 changes: 0 additions & 95 deletions .github/workflows/monokle-build-windows-nightly.yml

This file was deleted.

11 changes: 3 additions & 8 deletions .github/workflows/monokle-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ on:
workflow_dispatch:

jobs:
# This workflow contains a single job called "build"
build-mac:
lint-mac:
runs-on: macOS-latest

steps:
Expand All @@ -29,10 +28,6 @@ jobs:
sysctl -n machdep.cpu.brand_string
vm_stat | perl -ne '/page size of (\d+)/ and $size=$1; /Pages\s+([^:]+)[^\d]+(\d+)/ and printf("%-16s % 16.2f Mi\n", "$1:", $2 * $size / 1048576);'
- name: Install Tools
run: |
brew install tree
- name: Get Node Version
run: |
cat .nvmrc
Expand All @@ -50,12 +45,12 @@ jobs:
env
echo "npm: $(npm --version)"
echo "node: $(node --version)"
npm install --force
npm install --production=false
- name: Verify Dependencies
run: |
ls -la
tree node_modules -L 1
npm list --depth=1
- name: Lint
run: |
Expand Down
19 changes: 6 additions & 13 deletions .github/workflows/monokle-publish.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: monokle-publish

on:
push:
tags:
- 'v[0-9].[0-9]+.[0-9]+' # Should only grab tags without /
release:
types:
- prereleased
Expand All @@ -13,7 +10,7 @@ on:

jobs:
# This workflow contains a single job called "build"
build-mac:
build-and-publish-mac:
runs-on: macOS-latest

steps:
Expand All @@ -34,10 +31,6 @@ jobs:
sysctl -n machdep.cpu.brand_string
vm_stat | perl -ne '/page size of (\d+)/ and $size=$1; /Pages\s+([^:]+)[^\d]+(\d+)/ and printf("%-16s % 16.2f Mi\n", "$1:", $2 * $size / 1048576);'
- name: Install Tools
run: |
brew install tree
- name: Get Node Version
run: |
cat .nvmrc
Expand All @@ -55,12 +48,12 @@ jobs:
env
echo "npm: $(npm --version)"
echo "node: $(node --version)"
npm install --force
npm install
- name: Verify Dependencies
run: |
ls -la
tree node_modules -L 1
npm list --depth=1
- name: Build
run: |
Expand Down Expand Up @@ -108,7 +101,7 @@ jobs:
ls -la
if: ${{ always() }}

build-windows:
build-and-publishwindows:
runs-on: windows-latest

steps:
Expand Down Expand Up @@ -143,12 +136,12 @@ jobs:
Set-PSDebug -Trace 1
node --version
npm --version
npm install --force
npm install
- name: Verify Dependencies
run: |
cmd /r dir
cmd /r dir .\node_modules
npm list --depth=1
- name: Build
run: |
Expand Down
Loading

0 comments on commit 29ae56f

Please sign in to comment.