Skip to content

Commit

Permalink
Update build&deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
andypf authored Apr 12, 2024
1 parent 7cfaa87 commit 9fbd9db
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/build&deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,21 @@ jobs:
- name: build asset
run: |
# replace
jq '.name = "@${{ github.repository_owner }}/${{ env.ASSET_SCOPE }}${{ env.ASSET_NAME }}" | .private = false' \
"./${ASSET_TYPE}s/${ASSET_NAME}/package.json" > "/tmp/test.json" && \
cat "./${ASSET_TYPE}s/${ASSET_NAME}/package.json"
mv /tmp/test.json "./${ASSET_TYPE}s/${ASSET_NAME}/package.json"
npm -w @${{ github.repository_owner }}/${{ env.ASSET_SCOPE }}${{ env.ASSET_NAME }} run build
npm -w $ASSET_NAME run build
- name: Publish to github packages
run: |
# copy generated .npmrc to repository
cp $NPM_CONFIG_USERCONFIG ./
# replace name and private values
PACKAGE_JSON_PATH="./${ASSET_TYPE}s/${ASSET_NAME}/package.json"
jq '.name = "@${{ github.repository_owner }}/${{ env.ASSET_SCOPE }}${{ env.ASSET_NAME }}" | .private = false' \
$PACKAGE_JSON_PATH > /tmp/test.json && mv /tmp/test.json $PACKAGE_JSON_PATH
cat $PACKAGE_JSON_PATH
# publish to https://github.com/${{ github.repository_owner }}/packages
npm -w @${{ github.repository_owner }}/${{ env.ASSET_SCOPE }}${{ env.ASSET_NAME }} publish #--dry-run
npm -w "@${REPOSITORY_OWNER}/${ASSET_SCOPE}${ASSET_NAME}" publish #--dry-run
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPOSITORY_OWNER: ${{ github.repository_owner }}

0 comments on commit 9fbd9db

Please sign in to comment.