Skip to content

fix: release please #311

fix: release please

fix: release please #311

Workflow file for this run

name: Build
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: ".tool-versions"
cache: 'npm'
- run: npm ci
- run: npm run lint --if-present
- run: npm test
- run: npm run build
release:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
steps:
- name: Get release version
id: get_release_version
run: |
twilio_version=$(npm info twilio version | xargs echo)
echo "twilio_version=$twilio_version" >> $GITHUB_OUTPUT
- name: "Set release version"
run: |
cat release-please-config.json | jq '. + { "release-as": "${{ steps.get_release_version.outputs.twilio_version }}" }' > release-please-config.json
- uses: google-github-actions/release-please-action@v4
id: release
with:
token: ${{ secrets.SOMLENG_PERSONAL_ACCESS_TOKEN }}
config-file: release-please-config.json
- uses: actions/checkout@v4
if: ${{ steps.release.outputs.release_created }}
- name: Setup Node
uses: actions/setup-node@v4
if: ${{ steps.release.outputs.release_created }}
with:
node-version-file: ".tool-versions"
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- name: Publish node package
if: ${{ steps.release.outputs.release_created }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm ci
npm run build
npm publish