Skip to content

Commit

Permalink
ci: update to reusable workflow (#10)
Browse files Browse the repository at this point in the history
* ci: update to reusable workflow

* remove packageManager field

* fix

* fix

* fix
  • Loading branch information
MaikoTan authored Feb 17, 2024
1 parent 712b972 commit b27c8eb
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 27 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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
18 changes: 11 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
13 changes: 0 additions & 13 deletions .github/workflows/test.yml

This file was deleted.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"build": "yarn build:tsup --minify",
"dev": "yarn build:tsup",
"build:tsup": "tsup",
"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/**/*'"
Expand Down Expand Up @@ -75,7 +75,6 @@
"peerDependencies": {
"koishi": "^4.8.2"
},
"packageManager": "[email protected]",
"prettier": "@hamster-bot/prettier-config",
"devDependencies": {
"@hamster-bot/eslint-config": "*",
Expand All @@ -86,13 +85,15 @@
"@types/node": "^17.0.12",
"@typescript-eslint/eslint-plugin": "^5.30.5",
"@typescript-eslint/parser": "^5.30.5",
"esbuild-plugin-yaml": "^0.0.1",
"eslint": "^8.19.0",
"eslint-import-resolver-typescript": "^3.4.1",
"koishi": "^4.8.2",
"mocha": "^9.2.0",
"prettier": "^2.7.1",
"ts-node": "^10.8.1",
"tsup": "^8.0.1",
"typescript": "^4.7.3",
"tsx": "^4.7.1",
"typescript": "^5.3.3",
"yml-register": "^1.1.0"
}
}
6 changes: 5 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"extends": "@hamster-bot/tsconfig",
"compilerOptions": {
"outDir": "dist"
"outDir": "dist",
"types": ["node", "mocha"],
"skipLibCheck": true,
"jsx": "react-jsx",
"jsxImportSource": "@satorijs/element"
},
"include": ["src/**/*.ts"]
}
3 changes: 1 addition & 2 deletions tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ export default defineConfig({
clean: true,
outDir: 'lib',
esbuildPlugins: [yaml.yamlPlugin()],
esbuildOptions(options, context) {
},
esbuildOptions(options, context) {},
})

0 comments on commit b27c8eb

Please sign in to comment.