Skip to content

fix(php): relax websocket connect timeout for parity CI #22

fix(php): relax websocket connect timeout for parity CI

fix(php): relax websocket connect timeout for parity CI #22

Workflow file for this run

name: npm release
on:
push:
branches: [main]
release:
types: [published]
workflow_dispatch: {}
permissions:
contents: write
packages: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org
- name: Read package metadata
id: pkg
run: |
NAME=$(node -p "require('./package.json').name")
VERSION=$(node -p "require('./package.json').version")
echo "name=$NAME" >> "$GITHUB_OUTPUT"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Ensure unique version
id: version
env:
PKG_NAME: ${{ steps.pkg.outputs.name }}
PKG_VERSION: ${{ steps.pkg.outputs.version }}
run: |
if npm view "$PKG_NAME@$PKG_VERSION" version >/dev/null 2>&1; then
npm version patch --no-git-tag-version
NEW_VERSION=$(node -p "require('./package.json').version")
echo "changed=true" >> "$GITHUB_OUTPUT"
echo "version=$NEW_VERSION" >> "$GITHUB_OUTPUT"
echo "Bumped to $NEW_VERSION for publish"
else
echo "changed=false" >> "$GITHUB_OUTPUT"
echo "version=$PKG_VERSION" >> "$GITHUB_OUTPUT"
echo "Publishing $PKG_VERSION"
fi
- name: Install
run: npm ci
- name: Build
run: npm run build
- name: Publish
if: github.event_name != 'push'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --access public
- name: Skip publish on push
if: github.event_name == 'push'
run: echo "Skipping npm publish on push events"
- name: Commit version bump
if: github.event_name != 'push' && steps.version.outputs.changed == 'true'
env:
VERSION: ${{ steps.version.outputs.version }}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add package.json package-lock.json
git commit -m "chore: bump version to v${VERSION}"
git push origin HEAD:main