Skip to content

Comment out OpenAICompatibleSpeechToTextApi instantiation in example.… #5

Comment out OpenAICompatibleSpeechToTextApi instantiation in example.…

Comment out OpenAICompatibleSpeechToTextApi instantiation in example.… #5

name: Auto Release (Simple)
on:
push:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run lint
run: npm run lint
- name: Build package
run: npm run build
- name: Test package can be imported
run: node -e "require('./dist/index.js')"
check-version:
runs-on: ubuntu-latest
outputs:
version-changed: ${{ steps.version-check.outputs.changed }}
new-version: ${{ steps.version-check.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Check if version changed
id: version-check
run: |
# Get current version
CURRENT_VERSION=$(node -p "require('./package.json').version")
# Get previous version (from previous commit)
git checkout HEAD~1
PREVIOUS_VERSION=$(node -p "require('./package.json').version")
git checkout -
echo "Previous version: $PREVIOUS_VERSION"
echo "Current version: $CURRENT_VERSION"
if [ "$CURRENT_VERSION" != "$PREVIOUS_VERSION" ]; then
echo "changed=true" >> $GITHUB_OUTPUT
echo "version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
else
echo "changed=false" >> $GITHUB_OUTPUT
fi
release-and-publish:
needs: [test, check-version]
runs-on: ubuntu-latest
if: needs.check-version.outputs.version-changed == 'true'
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- name: Build package
run: npm run build
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ needs.check-version.outputs.new-version }}
release_name: Release v${{ needs.check-version.outputs.new-version }}
draft: false
prerelease: false
body: |
Changes in this release:
- Version bump to ${{ needs.check-version.outputs.new-version }}
For detailed changes, see the commit history.
- name: Publish to NPM
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}