Added github workflow for building dist files

This commit is contained in:
Peng-YM 2022-06-21 15:48:51 +08:00
parent 05b03b5337
commit 94262e162a
5 changed files with 80 additions and 13596 deletions

29
.github/workflows/main.yml vendored Normal file
View File

@ -0,0 +1,29 @@
name: update
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: 'master'
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "14"
- name: Install dependencies
run: cd backend && npm i
- name: Build
run: cd backend && npm run build
- name: Commit changes
if: contains(github.event.head_commit.message, '#build')
run: |
git config user.email github-actions
git config user.name github-actions@github.com
git add .
git commit -m "Release" -a
git push

View File

@ -6,7 +6,7 @@
*
*
* Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket!
* @updated: 2022/6/21 09:20:44
* @updated: 2022/6/21 04:41:29
* @version: 2.1.2
* @author: Peng-YM
* @github: https://github.com/Peng-YM/Sub-Store

View File

@ -15,7 +15,16 @@ export function peggy() {
.pipe(tap(function (file) {
const filename = path.basename(file.path).split(".")[0] + ".js";
const raw = fs.readFileSync(file.path, 'utf8');
const contents = `import * as peggy from 'peggy';\nconst grammars = String.raw\`\n${raw}\n\`;\nlet parser;\nexport default function getParser() { if(!parser) { parser = peggy.generate(grammars); } return parser; }`;
const contents =
`import * as peggy from 'peggy';
const grammars = String.raw\`\n${raw}\n\`;
let parser;
export default function getParser() {
if (!parser) {
parser = peggy.generate(grammars);
}
return parser;
}\n`;
return newFile(filename, contents)
.pipe(gulp.dest(path.dirname(file.path)))
}));
@ -67,7 +76,7 @@ function scripts(src, dest) {
function banner(dest) {
return () => gulp
.src(dest)
.pipe(header(fs.readFileSync('./banner', 'utf-8'), {pkg, updated: new Date().toLocaleString()}))
.pipe(header(fs.readFileSync('./banner', 'utf-8'), {pkg, updated: new Date().toLocaleString('zh-CN')}))
.pipe(gulp.dest((file) => file.base));
}

13630
backend/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@
*
*
* Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket!
* @updated: 2022/6/21 09:20:44
* @updated: 2022/6/21 04:41:29
* @version: 2.1.2
* @author: Peng-YM
* @github: https://github.com/Peng-YM/Sub-Store