mirror of
https://github.com/DeBrosOfficial/orama.git
synced 2026-03-27 11:04:12 +00:00
- upgrade go to 1.24 in release-apt.yml - add go.sum dependency caching to release workflows - update publish-sdk.yml to run vitest unit tests
81 lines
2.1 KiB
YAML
81 lines
2.1 KiB
YAML
name: Publish SDK to npm
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: "Version to publish (e.g., 1.0.0). Leave empty to use package.json version."
|
|
required: false
|
|
dry-run:
|
|
description: "Dry run (don't actually publish)"
|
|
type: boolean
|
|
default: false
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
publish:
|
|
name: Build & Publish @debros/orama
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: sdk
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "20"
|
|
registry-url: "https://registry.npmjs.org"
|
|
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 9
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Bump version
|
|
if: inputs.version != ''
|
|
run: npm version ${{ inputs.version }} --no-git-tag-version
|
|
|
|
- name: Typecheck
|
|
run: pnpm typecheck
|
|
|
|
- name: Build
|
|
run: pnpm build
|
|
|
|
- name: Run unit tests
|
|
run: pnpm vitest run tests/unit
|
|
|
|
- name: Publish (dry run)
|
|
if: inputs.dry-run == true
|
|
run: npm publish --access public --dry-run
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
|
|
- name: Publish
|
|
if: inputs.dry-run == false
|
|
run: npm publish --access public
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
|
|
- name: Get published version
|
|
if: inputs.dry-run == false
|
|
id: version
|
|
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
|
|
|
|
- name: Create git tag
|
|
if: inputs.dry-run == false
|
|
working-directory: .
|
|
run: |
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
git tag "sdk/v${{ steps.version.outputs.version }}"
|
|
git push origin "sdk/v${{ steps.version.outputs.version }}"
|