Skip to content

Commit

Permalink
add npm scripts dir to PATH in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
DetachHead committed Apr 4, 2024
1 parent 8b50ce6 commit a2e032c
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/build_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@ jobs:

- run: ./pw pdm install

- name: activate pyprojectx context
run: realpath ./.pyprojectx/main >> $GITHUB_PATH
# using relative path for npm scripts because it needs to work in the package directories too
- name: add pyprojectx and npm scripts to PATH

run: |
realpath ./.pyprojectx/main >> $GITHUB_PATH
./node_modules/.bin >> $GITHUB_PATH
- id: current-version
run: |
Expand All @@ -45,7 +49,7 @@ jobs:

- name: set version for npm packages
if: github.ref == 'refs/heads/main'
run: ./node_modules/.bin/lerna version ${{ steps.current-version.outputs.CURRENT_VERSION }} --yes --no-git-tag-version
run: lerna version ${{ steps.current-version.outputs.CURRENT_VERSION }} --yes --no-git-tag-version

- name: Build VSIX
working-directory: ${{ env.VSIX_DIR }}
Expand Down Expand Up @@ -81,12 +85,11 @@ jobs:
access: public
package: ${{ env.NPM_PACKAGE_DIR }}/package.json

# this isn't ideal. the pypi publish shouldn't be re-building the npm packages because they were already built easlier
# but i think to fix that i need to rewrite pdm_build.py to use the build hooks so we can control it more easily,
# but i can't get that to work soooo
# this isn't ideal, but it's required becayse pdm publish re-builds the npm packages even tho they were already built earlier.
# i think to fix that i need to rewrite pdm_build.py to use the build hooks so we can control it more easily, but i can't get that to work soooo
- name: set npm package versions back to upstream so pypi package can use it in --version output
if: github.ref == 'refs/heads/main'
run: ./node_modules/.bin/lerna version ${{ steps.current-version.outputs.CURRENT_UPSTREAM_VERSION }} --yes --no-git-tag-version
run: lerna version ${{ steps.current-version.outputs.CURRENT_UPSTREAM_VERSION }} --yes --no-git-tag-version

- name: publish package - pypi
if: github.ref == 'refs/heads/main' && steps.version-was-changed.outputs.VERSION_INFO == ''
Expand All @@ -95,12 +98,12 @@ jobs:
# https://code.visualstudio.com/api/working-with-extensions/publishing-extension#get-a-personal-access-token
- name: publish VSIX - visual studio marketplace
if: github.ref == 'refs/heads/main' && steps.version-was-changed.outputs.VERSION_INFO == ''
run: ./node_modules/.bin/vsce publish --packagePath ${{ env.VSIX_NAME }} --pat ${{ secrets.VSCE_TOKEN }} --noVerify
run: vsce publish --packagePath ${{ env.VSIX_NAME }} --pat ${{ secrets.VSCE_TOKEN }} --noVerify
working-directory: ${{ env.VSIX_DIR }}

- name: publish VSIX - open VSX
if: github.ref == 'refs/heads/main' && steps.version-was-changed.outputs.VERSION_INFO == ''
run: ./node_modules/.bin/ovsx publish --packagePath ${{ env.VSIX_NAME }} --pat ${{ secrets.OPEN_VSX_TOKEN }}
run: ovsx publish --packagePath ${{ env.VSIX_NAME }} --pat ${{ secrets.OPEN_VSX_TOKEN }}
working-directory: ${{ env.VSIX_DIR }}

- uses: marvinpinto/action-automatic-releases@v1.2.1
Expand Down

0 comments on commit a2e032c

Please sign in to comment.