Skip to content

Commit

Permalink
📦 Chore: azure -> github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
upupming committed Feb 2, 2020
1 parent c8129ed commit 5ae4ec2
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 121 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build
on:
push:
branches:
- dev
- master
jobs:
build-and-prerelease:
runs-on: macos-latest
steps:
- uses: actions/checkout@v1

- name: npm install, make test-coverage
run: |
npm install
npm run test
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build artifact
run: |
mkdir artifact
npm install -g vsce
rm README.md && vsce package -o artifact
- name: Upload artifact
uses: actions/upload-artifact@v1
with:
name: vs-picgo dev release
path: artifact
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![version](https://img.shields.io/vscode-marketplace/v/Spades.vs-picgo.svg?style=flat-square&label=vscode%20marketplace)](https://marketplace.visualstudio.com/items?itemName=Spades.vs-picgo)
[![installs](https://img.shields.io/vscode-marketplace/d/Spades.vs-picgo.svg?style=flat-square)](https://marketplace.visualstudio.com/items?itemName=Spades.vs-picgo)
[![Azure DevOps builds (branch)](https://img.shields.io/azure-devops/build/PicGo/9bbe4cd2-a9fe-4547-b13a-60ee81f12932/1/dev.svg?label=azure%20pipeline&style=flat-square)](https://dev.azure.com/PicGo/vs-picgo/_build?definitionId=1)
[![Build](https://github.com/PicGo/vs-picgo/workflows/Build/badge.svg?sanitize=true)](https://github.com/PicGo/vs-picgo/actions?query=workflow%3A%22Build%22)
[![Coveralls github branch](https://img.shields.io/coveralls/github/PicGo/vs-picgo/refs/heads/dev.svg?style=flat-square)](https://coveralls.io/github/PicGo/vs-picgo?branch=refs/heads/dev)
[![GitHub stars](https://img.shields.io/github/stars/PicGo/vs-picgo.svg?style=flat-square&label=github%20stars)](https://github.com/PicGo/vs-picgo)
[![PicGo Convention](https://img.shields.io/badge/picgo-convention-blue.svg?style=flat-square)](https://github.com/PicGo/bump-version)
Expand Down Expand Up @@ -87,7 +87,7 @@
<img src="https://i.loli.net/2019/04/09/5cac18a5c9def.png" alt="output-format.png">
</details>



<details>
<summary>
Expand Down Expand Up @@ -135,7 +135,7 @@

## Versioning

For the versions available, see the [tags on PicGo/vs-picgo](https://github.com/PicGo/vs-picgo/tags). ChangeLogs can be found at [CHANGELOG.md](CHANGELOG.md). All the dev builds can be found on [Azure](https://dev.azure.com/PicGo/vs-picgo/_build?definitionId=1), and you can just open the build of a specific commit, and go to the Summary tab to download the artifacts.
For the versions available, see the [tags on PicGo/vs-picgo](https://github.com/PicGo/vs-picgo/tags). ChangeLogs can be found at [CHANGELOG.md](CHANGELOG.md). All the dev builds can be found on [GitHub Actions](https://github.com/PicGo/vs-picgo/actions/), and you can just open the build of a specific commit, and go to the Summary tab to download the artifacts.

## Contributing

Expand Down
55 changes: 0 additions & 55 deletions azure-pipelines.yml

This file was deleted.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,8 @@
"watch": "tsc -watch -p ./",
"postinstall": "node ./node_modules/vscode/bin/install",
"test": "npm run compile && node ./node_modules/vscode/bin/test",
"coveralls": "powershell type ./coverage/lcov.info | coveralls",
"coveralls": "cat ./coverage/lcov.info | coveralls",
"coveralls:windows": "powershell type ./coverage/lcov.info | coveralls",
"lint": "prettier --list-different ./src/*.ts package.json package.nls.json",
"lint:fix": "prettier --write ./src/*.ts package.json package.nls.json",
"cz": "git-cz",
Expand Down Expand Up @@ -325,7 +326,7 @@
"dependencies": {
"lodash": "^4.17.11",
"lodash-id": "^0.14.0",
"picgo": "^1.3.6"
"picgo": "1.4.4"
},
"license": "MIT"
}
10 changes: 5 additions & 5 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as path from 'path';
import { IUploadName, IOutputUrl } from '../vs-picgo';
import { window } from 'vscode';
import { ImgInfo } from 'picgo/dist/utils/interfaces';
import { ImgInfo } from 'picgo/dist/src/utils/interfaces';

export function formatParam(file: string, mdFileName: string): IUploadName {
const dt = new Date();
Expand All @@ -12,9 +12,9 @@ export function formatParam(file: string, mdFileName: string): IUploadName {
const mm = dt.getMinutes();
const s = dt.getSeconds();

let pad = function (x: number) {
let pad = function(x: number) {
return ('00' + x).slice(-2);
}
};

const date = `${y}-${pad(m)}-${pad(d)}`;
var extName = path.extname(file);
Expand Down Expand Up @@ -61,10 +61,10 @@ export function showInfo(messgae: string) {
/**
* Return uploaded name accrding to `imgInfo.fileName`,
* extname will be removed for the sake of simplicity when used as alt.
* @param imgInfo
* @param imgInfo
*/
export function getUploadedName(imgInfo: ImgInfo): string {
let fullName
let fullName;
if (!imgInfo.fileName) {
fullName = '';
} else {
Expand Down
20 changes: 10 additions & 10 deletions src/vs-picgo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import * as path from 'path';
import * as os from 'os';
import * as vscode from 'vscode';

import PicGo from 'picgo/dist/core/PicGo';
import { ImgInfo, Plugin } from 'picgo/dist/utils/interfaces';
import PicGo from 'picgo/dist/src/core/PicGo';
import { ImgInfo, Plugin } from 'picgo/dist/src/utils/interfaces';

import { promisify } from 'util';

Expand Down Expand Up @@ -53,9 +53,13 @@ export default class VSPicgo {
configPicgo() {
const picgoConfigPath = vscode.workspace.getConfiguration('picgo').get<string>('configPath');
if (picgoConfigPath) {
VSPicgo.picgo.setConfig(JSON.parse(fs.readFileSync(picgoConfigPath, {
encoding: 'utf-8'
})));
VSPicgo.picgo.setConfig(
JSON.parse(
fs.readFileSync(picgoConfigPath, {
encoding: 'utf-8',
}),
),
);
} else {
const picBed = vscode.workspace.getConfiguration('picgo.picBed');
VSPicgo.picgo.setConfig({ picBed });
Expand All @@ -80,7 +84,7 @@ export default class VSPicgo {
if (err instanceof SyntaxError) {
showError(
`the data file ${this.dataPath} has syntax error, ` +
`please fix the error by yourself or delete the data file and vs-picgo will recreate for you.`,
`please fix the error by yourself or delete the data file and vs-picgo will recreate for you.`,
);
} else {
showError(`failed to read from data file ${this.dataPath}: ${err || ''}`);
Expand Down Expand Up @@ -173,10 +177,6 @@ export default class VSPicgo {
showError(`${notice.title}! ${notice.body || ''}${notice.text || ''}`);
reject();
});
VSPicgo.picgo.on('failed', error => {
showError(error.message);
reject();
});
});
},
);
Expand Down
46 changes: 21 additions & 25 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "out",
"lib": [
"es6"
],
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"sourceMap": true,
"rootDir": ".",
/* Strict Type-Checking Option */
"strict": true,
/* enable all strict type-checking options */
/* Additional Checks */
"noUnusedLocals": true /* Report errors on unused locals. */
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
// "noUnusedParameters": true, /* Report errors on unused parameters. */
},
"exclude": [
"node_modules",
".vscode-test"
]
}
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "out",
"lib": ["es6"],
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"sourceMap": true,
"rootDir": ".",
/* Strict Type-Checking Option */
"strict": true,
/* enable all strict type-checking options */
/* Additional Checks */
"noUnusedLocals": true /* Report errors on unused locals. */
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
// "noUnusedParameters": true, /* Report errors on unused parameters. */
},
"include": ["./src/**/*", "./test/**/*"],
"exclude": ["node_modules", ".vscode-test"]
}
43 changes: 22 additions & 21 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -941,12 +941,15 @@ commander@~2.8.1:
dependencies:
graceful-readlink ">= 1.0.0"

comment-json@^1.1.3:
version "1.1.3"
resolved "https://registry.npm.taobao.org/comment-json/download/comment-json-1.1.3.tgz#6986c3330fee0c4c9e00c2398cd61afa5d8f239e"
integrity sha1-aYbDMw/uDEyeAMI5jNYa+l2PI54=
dependencies:
json-parser "^1.0.0"
comment-json@^2.3.1:
version "2.4.1"
resolved "https://registry.npm.taobao.org/comment-json/download/comment-json-2.4.1.tgz#2b4223550dc2ec66d147fa43070a77228c86ff33"
integrity sha1-K0IjVQ3C7GbRR/pDBwp3IoyG/zM=
dependencies:
core-util-is "^1.0.2"
esprima "^4.0.1"
has-own-prop "^2.0.0"
repeat-string "^1.6.1"

commitizen@^3.0.7:
version "3.1.1"
Expand Down Expand Up @@ -1225,7 +1228,7 @@ core-js@^2.4.0, core-js@^2.5.0:
resolved "https://registry.npm.taobao.org/core-js/download/core-js-2.6.8.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcore-js%2Fdownload%2Fcore-js-2.6.8.tgz#dc3a1e633a04267944e0cb850d3880f340248139"
integrity sha1-3DoeYzoEJnlE4MuFDTiA80AkgTk=

core-util-is@1.0.2, core-util-is@~1.0.0:
core-util-is@1.0.2, core-util-is@^1.0.2, core-util-is@~1.0.0:
version "1.0.2"
resolved "https://registry.npm.taobao.org/core-util-is/download/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=
Expand Down Expand Up @@ -1677,12 +1680,12 @@ escodegen@1.8.x:
optionalDependencies:
source-map "~0.2.0"

esprima@2.7.x, esprima@^2.7.0, esprima@^2.7.1:
esprima@2.7.x, esprima@^2.7.1:
version "2.7.3"
resolved "https://registry.npm.taobao.org/esprima/download/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581"
integrity sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=

esprima@^4.0.0:
esprima@^4.0.0, esprima@^4.0.1:
version "4.0.1"
resolved "https://registry.npm.taobao.org/esprima/download/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71"
integrity sha1-E7BM2z5sXRnfkatph6hpVhmwqnE=
Expand Down Expand Up @@ -2328,6 +2331,11 @@ has-flag@^3.0.0:
resolved "https://registry.npm.taobao.org/has-flag/download/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0=

has-own-prop@^2.0.0:
version "2.0.0"
resolved "https://registry.npm.taobao.org/has-own-prop/download/has-own-prop-2.0.0.tgz#f0f95d58f65804f5d218db32563bb85b8e0417af"
integrity sha1-8PldWPZYBPXSGNsyVju4W44EF68=

has-symbol-support-x@^1.4.1:
version "1.4.2"
resolved "https://registry.npm.taobao.org/has-symbol-support-x/download/has-symbol-support-x-1.4.2.tgz#1409f98bc00247da45da67cee0a36f282ff26455"
Expand Down Expand Up @@ -2829,13 +2837,6 @@ json-parse-better-errors@^1.0.1:
resolved "https://registry.npm.taobao.org/json-parse-better-errors/download/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9"
integrity sha1-u4Z8+zRQ5pEHwTHRxRS6s9yLyqk=

json-parser@^1.0.0:
version "1.1.5"
resolved "https://registry.npm.taobao.org/json-parser/download/json-parser-1.1.5.tgz#e62ec5261d1a6a5fc20e812a320740c6d9005677"
integrity sha1-5i7FJh0aal/CDoEqMgdAxtkAVnc=
dependencies:
esprima "^2.7.0"

json-schema-traverse@^0.4.1:
version "0.4.1"
resolved "https://registry.npm.taobao.org/json-schema-traverse/download/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660"
Expand Down Expand Up @@ -3656,14 +3657,14 @@ performance-now@^2.1.0:
resolved "https://registry.npm.taobao.org/performance-now/download/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=

picgo@^1.3.6:
version "1.3.6"
resolved "https://registry.npm.taobao.org/picgo/download/picgo-1.3.6.tgz#61e7127fb3e161cc1b031df33294d313b79d88df"
integrity sha1-YecSf7PhYcwbAx3zMpTTE7ediN8=
picgo@1.4.4:
version "1.4.4"
resolved "https://registry.npm.taobao.org/picgo/download/picgo-1.4.4.tgz#4fd2d51793a7f90a144a816c60035ed1f2f76bf2"
integrity sha1-T9LVF5On+QoUSoFsYANe0fL3a/I=
dependencies:
chalk "^2.4.1"
commander "^2.17.0"
comment-json "^1.1.3"
comment-json "^2.3.1"
cross-spawn "^6.0.5"
dayjs "^1.7.4"
download-git-repo "^1.1.0"
Expand Down

0 comments on commit 5ae4ec2

Please sign in to comment.