Skip to content

Commit

Permalink
🐛 fix(config): 测试输出文件
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Jan 18, 2021
1 parent 687bd66 commit 08d2dad
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 6 deletions.
24 changes: 20 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,34 @@ name: Release CI
on: [push]
jobs:
release:
runs-on: macos-latest

name: Release
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@master
- uses: actions/checkout@v2
- name: Setup Node.js environment
uses: actions/setup-node@v2.1.2
with:
node-version: '14'

- name: Cache multiple paths
uses: actions/cache@v2
with:
path: |
~/.npm
~/cache
!~/cache/exclude
**/node_modules
key: npm-${{ runner.os }}-${{ hashFiles('package.json') }}

- name: install
run: yarn

- name: lint
run: yarn lint && yarn tsc

- name: build
run: yarn zip

- name: release
run: yarn release
env:
Expand Down
12 changes: 11 additions & 1 deletion .releaserc.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,17 @@ module.exports = {
},
],
'@semantic-release/npm', //如果是npm包会自动更新版本号并发布
'@semantic-release/github', // 推送代码回到GitHub
[
'@semantic-release/github',
{
assets: [
{
path: 'dist-zip/power-yuque.zip',
label: 'power-yuque.${nextRelease.gitTag}.zip',
},
],
},
], // 推送代码回到GitHub
[
'@semantic-release/git', //发布release
{
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"scripts": {
"start": "umi dev",
"build": "umi build",
"zip": "ts-node ./scripts/zip",
"zip": "yarn build && yarn zip:only",
"zip:only": "ts-node ./scripts/zip",
"--------- ": "",
"test": "umi-test",
"test:update": "UPDATE=1 umi-test --update-snapshot",
Expand Down
5 changes: 5 additions & 0 deletions scripts/zip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,15 @@ const buildZip = (src: string, dist: string, zipFilename: string) => {
const main = () => {
const { name, version } = extractExtensionData();
const zipFilename = `${name}-v${version}.zip`;
const zipDistName = `${name}.zip`;

makeDestZipDirIfNotExists();

buildZip(DEST_DIR, DEST_ZIP_DIR, zipFilename)
.then(() => console.info('✅ Build Done with Version!'))
.catch(console.error);

buildZip(DEST_DIR, DEST_ZIP_DIR, zipDistName)
.then(() => console.info('✅ Build Done!'))
.catch(console.error);
};
Expand Down

0 comments on commit 08d2dad

Please sign in to comment.