Skip to content

Fix undefined log level #3

Fix undefined log level

Fix undefined log level #3

Workflow file for this run

name: Build Javascript/Typescript
on:
push:
release:
types: [published]
jobs:
build-and-publish:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '21'
registry-url: 'https://npm.pkg.github.com'
- name: Build
run: |
TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
if [[ -n "$TAG" ]]; then
TAG=${TAG#v}
sed -i "s/\"version\": \".*\"/\"version\": \"$TAG\"/g" package.json
fi
npm run build
mkdir -p dist
npm pack --pack-destination dist/
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: dist-javascript
path: dist/*.tgz
- name: Upload release asset
if: github.event_name == 'release'
uses: softprops/action-gh-release@v1
with:
files: dist/*.tgz
- name: Publish to github package registry
if: github.event_name == 'release'
run: |
cd build/javascript
echo "Rename package to ${{ github.repository_owner }}/${{github.event.repository.name}} for github package registry"
sed -i 's/"name": "openagents-node-js-sdk"/"name": "@${{ github.repository_owner }}\/${{github.event.repository.name}}"/g' package.json
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > .npmrc
npm publish --registry https://npm.pkg.github.com --access public
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}