Skip to content

Commit

Permalink
chore: arguments-builder
Browse files Browse the repository at this point in the history
Update arguments-builder.config.ts
Update package.json
  • Loading branch information
VirgilClyne committed Oct 14, 2024
1 parent ead3f16 commit 31c2726
Show file tree
Hide file tree
Showing 27 changed files with 1,147 additions and 333 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,34 @@ jobs:
with:
submodules: recursive
token: ${{ secrets.SUBMODULE_TOKEN }}
ref: ${{github.ref_name}}
- name: Set up Node.js
uses: actions/setup-node@main
with:
node-version: 'latest'
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Update local package.json version from release tag
if: github.ref_type == 'tag'
uses: BellCubeDev/update-package-version-by-release-tag@v2
with:
version: ${{ github.ref_name }}
keep-v: "false" # If set to "true", will not remove any 'v' prefix from the version number.
ignore-semver-check: "false" # If set to "true", will not check if the version number is a valid semver version.
- name: Build
run: npm run build
if: github.ref_name == 'main' || github.ref_type == 'tag'
run: |
npm run build
npm run build:args
- name: Debug
if: github.ref_name == 'dev' || github.ref_name == 'debug'
run: npm run build:debug
- name: Upload artifact
uses: actions/upload-artifact@master
with:
name: output
name: artifact
path: |
.github/RELEASE-TEMPLATE.md
CHANGELOG.md
rulesets
modules
dist
33 changes: 0 additions & 33 deletions .github/workflows/debug.yml

This file was deleted.

9 changes: 4 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,17 @@ permissions:
contents: read

jobs:
debug:
uses: ./.github/workflows/debug.yml
build:
uses: ./.github/workflows/build.yml
secrets: inherit
deploy:
needs: debug
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@master
with:
name: dist
path: dist
name: artifact
- name: Deploy
uses: exuanbo/actions-deploy-gist@main
with:
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,23 @@ permissions:
contents: write

jobs:
test:
build:
uses: ./.github/workflows/build.yml
secrets: inherit
draft:
needs: test
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@master
with:
name: output
name: artifact
- name: Publish Draft
uses: softprops/action-gh-release@v2
with:
body_path: .github/RELEASE-TEMPLATE.md
body_path: CHANGELOG.md
token: ${{ secrets.GITHUB_TOKEN }}
files: |
rulesets/*
dist/*.js
modules/*
dist/*
draft: true
9 changes: 4 additions & 5 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*.*.*-alpha*'
- 'v*.*.*-beta*'
- v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+
- v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+

permissions:
actions: read
Expand All @@ -21,14 +21,13 @@ jobs:
- name: Download artifact
uses: actions/download-artifact@master
with:
name: output
name: artifact
- name: Publish Pre-Release
uses: softprops/action-gh-release@v2
with:
body_path: CHANGELOG.md
token: ${{ secrets.GITHUB_TOKEN }}
files: |
rulesets/*
dist/*.js
modules/*
dist/*
prerelease: true
7 changes: 3 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*.*.*-rc*'
- v[0-9]+.[0-9]+.[0-9]+

permissions:
actions: read
Expand All @@ -20,14 +20,13 @@ jobs:
- name: Download artifact
uses: actions/download-artifact@master
with:
name: output
name: artifact
- name: Publish Release
uses: softprops/action-gh-release@v2
with:
body_path: CHANGELOG.md
token: ${{ secrets.GITHUB_TOKEN }}
files: |
rulesets/*
dist/*.js
modules/*
dist/*
make_latest: "true"
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
* 首次发布
### 🔄 Other Changes
* 自动生成模块
85 changes: 85 additions & 0 deletions arguments-builder.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import { defineConfig } from "@iringo/arguments-builder";
export default defineConfig({
output: {
surge: { path: "./dist/TV.sgmodule" },
loon: { path: "./dist/TV.plugin" },
customItems: [
{
path: "./dist/TV.snippet",
template: "./template/quantumultx.handlebars",
},
{
path: "./dist/TV.stoverride",
template: "./template/stash.handlebars",
},
{
path: "./dist/TV.srmodule",
template: "./template/shadowrocket.handlebars",
},
],
dts: { isExported: true, path: "./src/interface.ts" },
boxjsSettings: {
path: "./template/boxjs.settings.json",
scope: "@iRingo.TV.Settings",
},
},
args: [
{
key: "Switch",
name: "总功能开关",
defaultValue: true,
type: "boolean",
description: "是否启用此APP修改",
exclude: ["surge", "loon"],
},
{
key: "ThirdParty",
name: "启用第三方App与TV app关联功能",
defaultValue: false,
type: "boolean",
description: "是否将桌面版/macOS版/app版等平台的TV app转换至iPad版,以启用第三方App与TV app关联功能(如: Disney+,Prime Video等)。",
},
{
key: "HLSUrl",
name: "HTTP实时流(HLS)地址",
defaultValue: "play-edge.itunes.apple.com",
type: "string",
description: "因为FPS服务域名禁止MitM,修改此地址可以分离HLS与FPS的域名,从而恢复对DualSubs的双语字幕支持。",
options: [
{
"key": "",
"label": "OFF(不修改)"
},
{
"key": "play.itunes.apple.com",
"label": "play.itunes.apple.com (不推荐,与播放服务域名重叠)"
},
{
"key": "play-edge.itunes.apple.com",
"label": "play-edge.itunes.apple.com (默认)"
}
]
},
{
key: "FPSUrl",
name: "FairPlay流(FPS)地址",
defaultValue: "play.itunes.apple.com",
type: "string",
description: "因为FPS服务域名禁止MitM,修改此地址可以分离HLS与FPS的域名,从而恢复对DualSubs的双语字幕支持。",
options: [
{
"key": "",
"label": "OFF(不修改)"
},
{
"key": "play.itunes.apple.com",
"label": "play.itunes.apple.com (默认)"
},
{
"key": "play-edge.itunes.apple.com",
"label": "play-edge.itunes.apple.com (不推荐,与播放服务域名重叠)"
}
]
},
],
});
25 changes: 0 additions & 25 deletions modules/TV.plugin

This file was deleted.

21 changes: 0 additions & 21 deletions modules/TV.sgmodule

This file was deleted.

22 changes: 0 additions & 22 deletions modules/TV.snippet

This file was deleted.

Loading

0 comments on commit 31c2726

Please sign in to comment.