From b3cae4c8588e7d4ccd0d1e42d653775110f958ae Mon Sep 17 00:00:00 2001 From: rafaelsideguide <150964962+rafaelsideguide@users.noreply.github.com> Date: Thu, 6 Jun 2024 13:27:31 -0300 Subject: [PATCH] adding js and testing twine --- .github/workflows/publish-js-sdk.yml | 48 ++++++++++++++++++++++++ .github/workflows/publish-python-sdk.yml | 13 ++----- apps/js-sdk/firecrawl/package.json | 2 +- 3 files changed, 52 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/publish-js-sdk.yml diff --git a/.github/workflows/publish-js-sdk.yml b/.github/workflows/publish-js-sdk.yml new file mode 100644 index 0000000..bfd61fa --- /dev/null +++ b/.github/workflows/publish-js-sdk.yml @@ -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 + + diff --git a/.github/workflows/publish-python-sdk.yml b/.github/workflows/publish-python-sdk.yml index 46cfd68..612a968 100644 --- a/.github/workflows/publish-python-sdk.yml +++ b/.github/workflows/publish-python-sdk.yml @@ -33,15 +33,6 @@ jobs: VERSION_INCREMENTED=$(python .github/scripts/check_version_has_incremented.py python ./apps/python-sdk/firecrawl firecrawl-py) 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 if: ${{ env.VERSION_INCREMENTED == 'true' }} run: | @@ -54,4 +45,6 @@ jobs: TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} run: | - echo "Publishing to PyPI" + twine upload dist/* + working-directory: ./apps/python-sdk + diff --git a/apps/js-sdk/firecrawl/package.json b/apps/js-sdk/firecrawl/package.json index d3581b3..3c2d604 100644 --- a/apps/js-sdk/firecrawl/package.json +++ b/apps/js-sdk/firecrawl/package.json @@ -1,6 +1,6 @@ { "name": "@mendable/firecrawl-js", - "version": "0.0.23", + "version": "0.0.24", "description": "JavaScript SDK for Firecrawl API", "main": "build/index.js", "types": "types/index.d.ts",