diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..6fb63d9 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,30 @@ +name: Publish + +on: + workflow_dispatch: + inputs: + npm-tag: + description: 'NPM tag to publish the package (e.g., latest, beta, etc.)' + required: false + default: 'latest' + type: string + dry-run: + description: 'Perform a dry run (true/false)' + required: false + default: false + type: boolean + +permissions: + contents: read + id-token: write + +jobs: + publish: + uses: collagejs/cicd/.github/workflows/npm-publish.yml@main + with: + node-version: 24 + build-script: build + test-script: test:cicd + npm-tag: ${{ inputs.npm-tag || 'latest' }} + dry-run: ${{ inputs.dry-run || false }} + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..73033dc --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,18 @@ +name: Test + +on: + pull_request: + branches: [main] + paths: + - 'src/**' + - 'package.json' + - 'tsconfig.json' + +jobs: + test: + uses: collagejs/cicd/.github/workflows/npm-test.yml@main + with: + node-version: 24 + build-script: build + test-script: test:cicd + build: false \ No newline at end of file diff --git a/package.json b/package.json index 51290af..071df8e 100644 --- a/package.json +++ b/package.json @@ -32,8 +32,9 @@ "dist" ], "scripts": { - "test": "vitest run --browser.enabled", - "test:watch": "vitest --browser.enabled", + "test": "vitest run", + "test:cicd": "npx playwright install && npm run test", + "test:watch": "vitest", "clean": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\"", "build:types": "tsc -p tsconfig.build.json", "build": "npm run clean && vite build && npm run build:types && publint"