diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6d1c2c8..8af8990 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,9 +2,6 @@ name: Plaindown CI on: workflow_dispatch: - push: - branches: - - main pull_request: types: [ opened, diff --git a/.github/workflows/pkg-vc.yml b/.github/workflows/pkg-vc.yml new file mode 100644 index 0000000..663a0cb --- /dev/null +++ b/.github/workflows/pkg-vc.yml @@ -0,0 +1,48 @@ +name: Publish to pkg.vc + +on: + pull_request: + paths: + - "src/**" + - "package.json" + - "bun-lock.yaml" + - "tsconfig.json" + workflow_dispatch: + inputs: + branch: + description: 'Branch to publish from' + required: true + default: 'main' + type: string + +permissions: + pull-requests: write + contents: read + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ github.event.inputs.branch || github.ref }} + + - name: Set up Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: 1.3.12 + + - name: Install dependencies + run: bun install --frozen-lockfile + + - name: Build package + run: bun run build + + - name: Publish to pkg.vc + uses: pkg-vc/publish-action@main + with: + organization: itznotabug + directory: ./ + secret: ${{ secrets.PKG_VC_SECRET }} + github-token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6369ce9..1c81237 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -24,15 +24,6 @@ jobs: - name: Install dependencies run: bun install --frozen-lockfile - - name: Lint - run: bun run lint - - - name: Typecheck - run: bun run typecheck - - - name: Test - run: bun test - - name: Build package run: bun run build @@ -43,6 +34,4 @@ jobs: registry-url: 'https://registry.npmjs.org' - name: Publish to npm - run: npm publish --provenance --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npm publish --provenance --access public \ No newline at end of file diff --git a/README.md b/README.md index 1bf6675..296e47a 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ [![npm version](https://img.shields.io/npm/v/@itznotabug/plaindown.svg?logo=npm&logoColor=white)](https://www.npmjs.com/package/@itznotabug/plaindown) [![License](https://img.shields.io/npm/l/%40itznotabug%2Fplaindown?logo=apache&logoColor=white&color=blue)](https://github.com/ItzNotABug/plaindown/blob/main/LICENSE) +[![CI](https://img.shields.io/github/actions/workflow/status/ItzNotABug/plaindown/ci.yml?logo=github&label=CI)](https://github.com/ItzNotABug/plaindown/actions/workflows/ci.yml) +[![Previews](https://img.shields.io/badge/Previews-pkg.vc-blueviolet)](https://pkg.vc/) [![Vite](https://img.shields.io/badge/Vite-5.x%20|%206.x%20-646CFF.svg?logo=vite&logoColor=white)](https://vite.dev/) [![VitePress](https://img.shields.io/badge/VitePress-1.x-5a67d8.svg?logo=vitepress&logoColor=white)](https://vitepress.dev/) [![TypeScript](https://img.shields.io/badge/TypeScript-ready-3178C6.svg?logo=typescript&logoColor=white)](https://www.typescriptlang.org/)