Skip to content

Commit

Permalink
chore: arguments-builder
Browse files Browse the repository at this point in the history
Update arguments-builder.config.ts
  • Loading branch information
VirgilClyne committed Oct 13, 2024
1 parent b80e1a2 commit 37eda13
Show file tree
Hide file tree
Showing 23 changed files with 715 additions and 227 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,22 @@ jobs:
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Build
- 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 scripts
run: npm run build
- name: Generate modules
run: npm run build:args
- name: Upload artifact
uses: actions/upload-artifact@master
with:
name: output
name: artifact
path: |
.github/RELEASE-TEMPLATE.md
CHANGELOG.md
rulesets
modules
dist
2 changes: 1 addition & 1 deletion .github/workflows/debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ jobs:
- name: Upload artifact
uses: actions/upload-artifact@master
with:
name: dist
name: artifact
path: dist
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Download artifact
uses: actions/download-artifact@master
with:
name: dist
name: artifact
path: dist
- name: Deploy
uses: exuanbo/actions-deploy-gist@main
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"
64 changes: 64 additions & 0 deletions arguments-builder.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import { defineConfig } from "@iringo/arguments-builder";
export default defineConfig({
output: {
surge: { path: "./dist/News.sgmodule" },
loon: { path: "./dist/News.plugin" },
customItems: [
{
path: "./dist/News.snippet",
template: "./template/quantumultx.handlebars",
},
{
path: "./dist/News.stoverride",
template: "./template/stash.handlebars",
},
{
path: "./dist/News.srmodule",
template: "./template/shadowrocket.handlebars",
},
],
dts: { isExported: true, path: "./src/interface.ts" },
boxjsSettings: {
path: "./template/boxjs.settings.json",
scope: "@iRingo.News.Settings",
},
},
args: [
{
key: "Switch",
name: "总功能开关",
defaultValue: true,
type: "boolean",
description: "是否启用此APP修改。",
exclude: ["surge", "loon"],
},
{
key: "CountryCode",
name: "国家或地区代码",
defaultValue: "US",
type: "string",
options: [
{ key: "AUTO", label: "🇺🇳自动(跟随地区检测结果)" },
{ key: "CN", label: "🇨🇳中国大陆" },
{ key: "HK", label: "🇭🇰香港" },
{ key: "TW", label: "🇹🇼台湾" },
{ key: "SG", label: "🇸🇬新加坡" },
{ key: "US", label: "🇺🇸美国" },
{ key: "JP", label: "🇯🇵日本" },
{ key: "AU", label: "🇦🇺澳大利亚" },
{ key: "GB", label: "🇬🇧英国" },
{ key: "KR", label: "🇰🇷韩国" },
{ key: "CA", label: "🇨🇦加拿大" },
{ key: "IE", label: "🇮🇪爱尔兰" },
],
description: "不同国家或地区提供的内容或有差别。",
},
{
key: "NewsPlusUser",
name: "[搜索]显示News+内容",
defaultValue: true,
type: "boolean",
description: "是否显示News+搜索结果。",
},
],
});
18 changes: 0 additions & 18 deletions modules/News.NoProxy.sgmodule

This file was deleted.

27 changes: 0 additions & 27 deletions modules/News.plugin

This file was deleted.

24 changes: 0 additions & 24 deletions modules/News.sgmodule

This file was deleted.

26 changes: 0 additions & 26 deletions modules/News.snippet

This file was deleted.

16 changes: 0 additions & 16 deletions modules/News.srmodule

This file was deleted.

Loading

0 comments on commit 37eda13

Please sign in to comment.