0

adding js and testing twine

This commit is contained in:
rafaelsideguide 2024-06-06 13:27:31 -03:00
parent 63f0214d60
commit b3cae4c858
3 changed files with 52 additions and 11 deletions

48
.github/workflows/publish-js-sdk.yml vendored Normal file
View File

@ -0,0 +1,48 @@
name: Publish Package to npm
on:
pull_request:
branches:
- main
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "20"
- name: Install pnpm
run: npm install -g pnpm
- name: Install python for running version check script
run: |
python -m pip install --upgrade pip
pip install setuptools wheel requests packaging
- name: Install dependencies for JavaScript SDK
run: pnpm install
working-directory: ./apps/js-sdk/firecrawl
- name: Run version check script
id: version_check_script
run: |
VERSION_INCREMENTED=$(python .github/scripts/check_version_has_incremented.py js ./apps/js-sdk/firecrawl @mendable/firecrawl-js)
echo "VERSION_INCREMENTED=$VERSION_INCREMENTED" >> $GITHUB_ENV
- name: Build and publish to npm
if: ${{ env.VERSION_INCREMENTED == 'true' }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm run publish
working-directory: ./apps/js-sdk/firecrawl

View File

@ -33,15 +33,6 @@ jobs:
VERSION_INCREMENTED=$(python .github/scripts/check_version_has_incremented.py python ./apps/python-sdk/firecrawl firecrawl-py) VERSION_INCREMENTED=$(python .github/scripts/check_version_has_incremented.py python ./apps/python-sdk/firecrawl firecrawl-py)
echo "VERSION_INCREMENTED=$VERSION_INCREMENTED" >> $GITHUB_ENV echo "VERSION_INCREMENTED=$VERSION_INCREMENTED" >> $GITHUB_ENV
- name: Debug output of version check
run: |
echo "Output of VERSION_INCREMENTED: '${{ env.VERSION_INCREMENTED }}'"
- name: Set published version environment variable
if: ${{ env.VERSION_INCREMENTED == 'true' }}
run: |
echo "Published Version: ${{ env.VERSION_INCREMENTED }}"
- name: Build the package - name: Build the package
if: ${{ env.VERSION_INCREMENTED == 'true' }} if: ${{ env.VERSION_INCREMENTED == 'true' }}
run: | run: |
@ -54,4 +45,6 @@ jobs:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: | run: |
echo "Publishing to PyPI" twine upload dist/*
working-directory: ./apps/python-sdk

View File

@ -1,6 +1,6 @@
{ {
"name": "@mendable/firecrawl-js", "name": "@mendable/firecrawl-js",
"version": "0.0.23", "version": "0.0.24",
"description": "JavaScript SDK for Firecrawl API", "description": "JavaScript SDK for Firecrawl API",
"main": "build/index.js", "main": "build/index.js",
"types": "types/index.d.ts", "types": "types/index.d.ts",