From cb634c35a69d98d367599b2e4e6aa84257809220 Mon Sep 17 00:00:00 2001 From: Maiko Tan Date: Sat, 17 Feb 2024 23:16:45 +0800 Subject: [PATCH 1/4] ci: update reusable workflows --- .github/workflows/build.yml | 18 ++++++++++++++++++ .github/workflows/publish.yml | 18 +++++++++++------- .github/workflows/test.yml | 13 ------------- 3 files changed, 29 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..857807b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,18 @@ +name: Build + +on: + push: + pull_request: + +jobs: + build: + uses: AwesomeHamster/workflows/.github/workflows/build.yml@master + permissions: + pull-requests: write + issues: write + with: + lint: true + test: true + yarn-no-immutable: true + approve: true + secrets: inherit diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9d047cd..31b9037 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,10 +6,14 @@ on: jobs: publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: AwesomeHamster/actions-publish@master - with: - token: ${{ secrets.NPM_TOKEN }} - test: yarn test + uses: AwesomeHamster/workflows/.github/workflows/publish.yml@master + permissions: + contents: write + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + with: + yarn-no-immutable: true + test-before-publish: true + secrets: + npm-token: ${{ secrets.NPM_TOKEN }} + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 5d005df..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Test -on: [push, pull_request] - -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: AwesomeHamster/actions-test@master - with: - test: | - yarn lint - yarn test From 31db062249bd0d98a59be39934742b4801f5a3d8 Mon Sep 17 00:00:00 2001 From: Maiko Tan Date: Sat, 17 Feb 2024 23:18:41 +0800 Subject: [PATCH 2/4] chore: update several dev tools --- package.json | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 3dd81a9..9383741 100644 --- a/package.json +++ b/package.json @@ -35,8 +35,7 @@ "build": "yarn build:tsup --minify", "dev": "yarn build:tsup", "build:tsup": "tsup", - "clean": "rm -rf ./dist", - "test": "mocha -r ts-node/register -r yml-register --extension .spec.ts ./__tests__", + "test": "mocha -r tsx -r yml-register --extension .spec.ts ./__tests__", "lint": "eslint src/**/*.ts && yarn prettier --check", "format": "yarn prettier --write", "prettier": "prettier '**/*.{js,ts,json,yml,yaml,md}' '!lib/**/*'" @@ -74,16 +73,18 @@ "chai": "^4.3.4", "eslint": "^8.19.0", "eslint-import-resolver-typescript": "^3.4.1", + "koishi": "^4.7.0", + "koishi-plugin-puppeteer": "^3.3.1", "mocha": "^9.1.3", "prettier": "^2.7.1", - "ts-node": "^10.8.1", "tsup": "^8.0.1", + "tsx": "^4.7.1", "typescript": "^4.7.3", "yml-register": "^1.1.0" }, "peerDependencies": { - "@koishijs/plugin-puppeteer": "^3.1.1", - "koishi": "^4.7.0" + "koishi": "^4.7.0", + "koishi-plugin-puppeteer": "^3.3.1" }, "dependencies": { "lodestone-news": "^0.1.2" From 63270c835aa10baac1e3144e1dccdb85f2d3bbd2 Mon Sep 17 00:00:00 2001 From: Maiko Tan Date: Sat, 17 Feb 2024 23:19:35 +0800 Subject: [PATCH 3/4] fix --- tsup.config.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tsup.config.ts b/tsup.config.ts index b4b6e3e..2b535e5 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -8,6 +8,5 @@ export default defineConfig({ clean: true, outDir: 'lib', esbuildPlugins: [yaml.yamlPlugin()], - esbuildOptions(options, context) { - }, + esbuildOptions(options, context) {}, }) From 1800b9663ee70ee65da83df02642c03ea1a714dc Mon Sep 17 00:00:00 2001 From: Maiko Tan Date: Sat, 17 Feb 2024 23:20:51 +0800 Subject: [PATCH 4/4] fix --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 9383741..dafa39d 100644 --- a/package.json +++ b/package.json @@ -71,6 +71,7 @@ "@typescript-eslint/eslint-plugin": "^5.30.5", "@typescript-eslint/parser": "^5.30.5", "chai": "^4.3.4", + "esbuild-plugin-yaml": "^0.0.1", "eslint": "^8.19.0", "eslint-import-resolver-typescript": "^3.4.1", "koishi": "^4.7.0",