Skip to content

Commit

Permalink
build: Merge pull request #703 from keindev/dev
Browse files Browse the repository at this point in the history
build: release v6.0.0
  • Loading branch information
Daniil Ryazanov authored Jan 3, 2022
2 parents 7ee519c + 8c20b49 commit 188e338
Show file tree
Hide file tree
Showing 18 changed files with 7,635 additions and 9,074 deletions.
11 changes: 9 additions & 2 deletions .config/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
{
"configurations": [
{
"name": "Example app.js",
"name": "Example",
"type": "node",
"request": "launch",
"outputCapture": "std",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "node",
"runtimeArgs": ["--experimental-specifier-resolution=node", "--nolazy", "--inspect-brk=9229", "example/app.js"],
"runtimeArgs": [
"--experimental-specifier-resolution=node",
"--nolazy",
"--inspect-brk=9229",
"--loader",
"ts-node/esm",
"example/app.ts"
],
"port": 9229
}
]
Expand Down
3 changes: 0 additions & 3 deletions .config/typedoc.json

This file was deleted.

28 changes: 14 additions & 14 deletions .ghinfo
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
{
"name": "tasktree-cli",
"version": "5.1.0",
"version": "6.0.0",
"description": "Simple terminal task tree - helps you keep track of your tasks in a tree structure.",
"keywords": [
"ascii",
"busy",
"cli",
"task",
"tree",
"terminal",
"term",
"console",
"ascii",
"loading",
"idle",
"indicator",
"loading",
"progress",
"busy",
"wait",
"idle"
"task",
"term",
"terminal",
"tree",
"wait"
],
"repo": "keindev/tasktree",
"type": "utils",
"links": {
"homepage": "https://github.com/keindev/tasktree#readme",
"git": "https://github.com/keindev/tasktree",
"npm": "https://www.npmjs.com/package/tasktree-cli",
"homepage": "https://github.com/keindev/tasktree#readme"
"npm": "https://www.npmjs.com/package/tasktree-cli"
},
"files": {
"banner": "media/banner.svg",
"demo": "media/demo.gif",
"logo": "media/logo.svg",
"social-preview": "media/social-preview.png"
"logo": "media/logo.svg"
}
}
28 changes: 28 additions & 0 deletions .github/scripts/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import semver from 'semver';
import { promises as fs } from 'fs';

const packageData = await fs.readFile(new URL('../../package.json', import.meta.url));
const { engines } = JSON.parse(packageData);

const comparators = semver
.toComparators(engines.node)
.flat()
.map(v => semver.coerce(v));
const minVersion = semver.minSatisfying(comparators, engines.node).version;
const maxVersion = semver.maxSatisfying(comparators, engines.node).version;
const mainVersion = `${semver.major(maxVersion)}.x`;

console.log(
JSON.stringify({
node: {
matrix: {
node: [minVersion, mainVersion],
os: ['ubuntu-latest'],
},
main: {
version: mainVersion,
os: 'ubuntu-latest',
},
},
})
);
103 changes: 75 additions & 28 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,58 @@
name: Build

on: [push, pull_request]
on:
push:
branches:
- '*'
- '!main'
pull_request:
branches:
- '*'

jobs:
config:
name: Configure
runs-on: ubuntu-latest
outputs:
config: ${{ steps.set-config.outputs.config }}
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2

- name: Create config
id: set-config
run: |
echo Node: $(node -v)
echo NPM: $(npm -v)
npm i semver
CONFIG=$(node ./.github/scripts/config.js | sed 's/ //g')
echo "::set-output name=config::$CONFIG"
echo $CONFIG
test:
name: Test
runs-on: ${{ matrix.os }}
needs: [ config ]
strategy:
matrix:
node-version: [14.x, 15.x]
os: [ubuntu-latest]
matrix: ${{ fromJson(needs.config.outputs.config).node.matrix }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Node.js v${{ matrix.node-version }}
- name: Setup Node.js v${{ matrix.node }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
node-version: ${{ matrix.node }}

- name: Cache node modules
id: cache-npm
uses: actions/cache@v2
with:
path: ~/.npm
key: npm-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
key: npm-${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}

- name: Install Dependencies
run: npm ci
Expand All @@ -37,34 +65,33 @@ jobs:
npm run test
- name: Cache coverage
if: ${{ success() && matrix.node-version == '15.x' }}
if: ${{ success() && matrix.node == '16.x' }}
uses: actions/cache@v2
with:
path: coverage
key: coverage-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('src/**/*.*', '**/package-lock.json') }}
key: coverage-${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('src/**/*.*', '**/package-lock.json') }}

build:
name: Build
needs: [test]
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [15.x]
needs: [ test, config ]
env:
NODE_VERSION: ${{ fromJson(needs.config.outputs.config).node.main.version }}
runs-on: ${{ fromJson(needs.config.outputs.config).node.main.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
node-version: ${{ env.NODE_VERSION }}

- name: Cache node modules
id: cache-npm
uses: actions/cache@v2
with:
path: ~/.npm
key: npm-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
key: npm-${{ runner.os }}-${{ env.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}

- name: Install Dependencies
run: npm ci
Expand All @@ -77,11 +104,10 @@ jobs:
coverage:
name: Coverage
if: ${{ github.event_name == 'push' }}
needs: [build]
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [15.x]
needs: [ build, config ]
env:
NODE_VERSION: ${{ fromJson(needs.config.outputs.config).node.main.version }}
runs-on: ${{ fromJson(needs.config.outputs.config).node.main.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
Expand All @@ -91,21 +117,21 @@ jobs:
uses: actions/cache@v2
with:
path: coverage
key: coverage-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('src/**/*.*', '**/package-lock.json') }}
key: coverage-${{ runner.os }}-${{ env.NODE_VERSION }}-${{ hashFiles('src/**/*.*', '**/package-lock.json') }}

- name: Setup Node.js v${{ matrix.node-version }}
- name: Setup Node.js v${{ env.NODE_VERSION }}
if: steps.cache-coverage.outputs.cache-hit != 'true'
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
node-version: ${{ env.NODE_VERSION }}

- name: Cache node modules
if: steps.cache-coverage.outputs.cache-hit != 'true'
id: cache-npm
uses: actions/cache@v2
with:
path: ~/.npm
key: npm-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
key: npm-${{ runner.os }}-${{ env.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}

- name: Test
if: steps.cache-coverage.outputs.cache-hit != 'true'
Expand All @@ -120,9 +146,30 @@ jobs:
with:
file: ./coverage/lcov.info

status:
name: Success build
if: ${{ always() }}
runs-on: ubuntu-latest
needs: [ test, build, coverage ]
steps:
- id: status
name: Load failure jobs count
env:
URL: https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs
USER: admin:${{ secrets.GITHUB_TOKEN }}
FILTER: "[.jobs[] | select(.status==\"completed\" and .conclusion==\"failure\") | { status: .conclusion, matrix: .name}] | length"
run: |
failure_count=$(curl -X GET -s -u $USER $URL | jq "$FILTER")
echo "::set-output name=failure_count::$failure_count"
echo Failure jobs count: $failure_count
- if: ${{ steps.status.outputs.failure_count > 0 }}
name: Fail
run: exit 1

discord:
name: Discord notification
needs: [test, build, coverage]
needs: [ status ]
if: ${{ always() }}
runs-on: ubuntu-latest
env:
Expand Down
50 changes: 34 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,42 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

config:
name: Configure
runs-on: ubuntu-latest
outputs:
config: ${{ steps.set-config.outputs.config }}
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2

- name: Create config
id: set-config
run: |
echo Node: $(node -v)
echo NPM: $(npm -v)
npm i semver --no-package-lock
CONFIG=$(node ./.github/scripts/config.js | sed 's/ //g')
echo "::set-output name=config::$CONFIG"
echo $CONFIG
publish:
name: Publish
needs: [sync]
needs: [ sync, config ]
env:
NODE_VERSION: ${{ fromJson(needs.config.outputs.config).node.main.version }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [15.x]
steps:
- name: Checkout repository
uses: actions/checkout@v1

- name: Setup Node.js v${{ matrix.node-version }}
- name: Setup Node.js v${{ env.NODE_VERSION }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
node-version: ${{ env.NODE_VERSION }}

- name: Install Dependencies
run: npm ci
Expand All @@ -55,19 +76,18 @@ jobs:

release:
name: Create Release
needs: [publish]
needs: [ publish, config ]
env:
NODE_VERSION: ${{ fromJson(needs.config.outputs.config).node.main.version }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [15.x]
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
node-version: ${{ env.NODE_VERSION }}

- name: Get package version
run: node -p -e '`PACKAGE_VERSION=${require("./package.json").version}`' >> $GITHUB_ENV
Expand All @@ -84,7 +104,7 @@ jobs:

discord:
name: Discord notification
needs: [publish, release]
needs: [ publish, release ]
if: ${{ always() }}
runs-on: ubuntu-latest
env:
Expand All @@ -97,10 +117,8 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Get package version
run: |
Expand Down
Loading

0 comments on commit 188e338

Please sign in to comment.