Skip to content

Commit

Permalink
auto post workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
zmh-program committed May 3, 2023
1 parent 975518d commit e73297e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 8 deletions.
22 changes: 15 additions & 7 deletions .github/workflows/webpack.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: NodeJS with Webpack

name: Build Script
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
release:
types: [published]

jobs:
build:
Expand All @@ -22,7 +19,18 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: Build
- name: Build Script
run: |
npm install
npx webpack
- name: Upload Script
uses: actions/upload-release-asset@v1.0.2
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./dist/extension.js
asset_name: extension.js
asset_content_type: text/javascript
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ turbowarp-ts-plugin是一个高效开发部署turbowarp扩展的插件, 提供:
- 🎃 **注册异常检测** 注册扩展时检查异常情况并拦截汇报
- 🎉 **Typescript 支持** 提供更好的类型检查和自动补全功能
- 🍎 **ESLint 修复** 自动格式化代码, 保持统一的风格和规范
- 🎉 **Action 自动打包** 使用action实现自动打包并加入release中, 方便在线获取

## 开发
1. 初始化安装依赖 (**yarn** **pnpm**同理, 推荐**pnpm**)
Expand Down Expand Up @@ -178,4 +179,8 @@ new Extension({

实际上, 出于文档大小考虑, 这里只节选了一个方块的扩展示例, 那如果是做一个[云数据库](https://gitee.com/LinwinSoft/open-data-api/blob/master/40code/extension.ts)扩展呢? 更大的代码量, 在接口和方法上反复穿行...

所以结合了这一现状, 此插件借鉴Django路由的传参方式设计了更好的接口风格, 此插件的接口代码量仅占约原生的**30~45%**
所以结合了这一现状, 此插件借鉴Django路由的传参方式设计了更好的接口风格, 此插件的接口代码量仅占约原生的**30~45%**.


## Release 自动打包发布
仓库密钥配置 `TOKEN` 为你的 [GitHub Token](https://github.com/settings/tokens/new), 当发布Release时, 会自动触发事件打包发送.
5 changes: 5 additions & 0 deletions docs/en.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- 🎃 **Registration Exception Detection** Check for exceptions and intercept reports when registering extensions
- 🎉 **Typescript support** provides better type checking and auto-completion
- 🍎 **ESLint Fix** Automatically formats code to maintain a consistent style and specification
- 🎉 **Action Auto Build** Use action to implement auto-package and add to release, easy to get online

## Development
1. Initial installation of dependencies (**yarn** **pnpm** same, **pnpm** recommended)
Expand Down Expand Up @@ -178,3 +179,7 @@ new Extension({
In fact, for documentation size reasons, only a single cube extension example is excerpted here, but what about a [cloud database](https://gitee.com/LinwinSoft/open-data-api/blob/master/40code/extension.ts) extension? A much larger amount of code, iterating through interfaces and methods...

So with that in mind, this plugin takes a page from Django's routing and passes it through a better interface style, which is only about **30~45%** of the native interface code.

## Release Automated Build and Release

Configure `TOKEN` as your [GitHub Token](https://github.com/settings/tokens/new) for the repository key, which will automatically trigger an event package to be sent when the Release is released

0 comments on commit e73297e

Please sign in to comment.