Skip to content

fix: remove stream property from DashScopeTransformer class #11

fix: remove stream property from DashScopeTransformer class

fix: remove stream property from DashScopeTransformer class #11

Workflow file for this run

name: Publish npm packages
on:
pull_request:
types: [closed]
jobs:
publish:
runs-on: ubuntu-latest
# Automatically publish the package version when a PR with the release label is merged
if: contains(github.event.pull_request.labels.*.name, 'release') && github.event.pull_request.merged == true
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }}
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: npm install
- name: Run ci
run: npm run ci
- name: Get version from package.json
id: version
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
- name: Create and push tag
run: |
git config --local user.email "${{ github.actor }}@users.noreply.github.com"
git config --local user.name "${{ github.actor }}"
TAG_NAME="v${{ steps.version.outputs.version }}"
if git rev-parse "$TAG_NAME" >/dev/null 2>&1; then
echo "Tag $TAG_NAME already exists, skipping tag creation"
else
echo "Creating tag $TAG_NAME"
git tag "$TAG_NAME"
git push origin "$TAG_NAME"
fi
- name: Publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
npm publish || {
if [[ $? -eq 1 && $(npm view @dashscope-js/claude-code-config@${{ steps.version.outputs.version }} version 2>/dev/null) == "${{ steps.version.outputs.version }}" ]]; then
echo "Version ${{ steps.version.outputs.version }} already exists on npm, skipping publish"
exit 0
else
echo "Publish failed with error code $?"
exit 1
fi
}