Skip to content

Commit

Permalink
Merge pull request #42 from Bandwidth/DX-2212
Browse files Browse the repository at this point in the history
DX-2122 Add NPM Release Logic
  • Loading branch information
ajrice6713 authored Sep 23, 2021
2 parents 46aa43b + 5b2b8b9 commit e731b04
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 16 deletions.
8 changes: 8 additions & 0 deletions .github/draft_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name-template: 'v$NEXT_MINOR_VERSION'
tag-template: 'v$NEXT_MINOR_VERSION'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
exclude-labels:
- 'skip-changelog'
template: |
## Changes
$CHANGES
40 changes: 40 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Deploy
on:
release:
types:
- published
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
if: ${{ !github.event.release.prerelease && github.event.release.target_commitish == 'main' }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set release version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '12.x'
registry-url: 'https://registry.npmjs.org'
- name: Build and test npm package
run: |
npm install
npm run build
npm run test --if-present
env:
BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }}
BW_USERNAME: ${{ secrets.BW_USERNAME }}
BW_PASSWORD: ${{ secrets.BW_PASSWORD }}
BW_VOICE_APPLICATION_ID: ${{ secrets.BW_VOICE_APPLICATION_ID }}
BW_MESSAGING_APPLICATION_ID: ${{ secrets.BW_MESSAGING_APPLICATION_ID }}
BW_NUMBER: ${{ secrets.BW_NUMBER }}
USER_NUMBER: ${{ secrets.USER_NUMBER }}
BASE_CALLBACK_URL: ${{ secrets.BASE_CALLBACK_URL }}
- name: Publish npm package
run: |
npm version $RELEASE_VERSION --no-git-tag-version
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
19 changes: 19 additions & 0 deletions .github/workflows/release-draft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Create/update draft release

on:
push:
branches:
- main

jobs:
deploy:
name: deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Drafts your next Release notes as Pull Requests are merged
- uses: release-drafter/release-drafter@v5
with:
config-name: draft_release.yml
env:
GITHUB_TOKEN: ${{ secrets.BW_GITHUB_TOKEN }}
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

0 comments on commit e731b04

Please sign in to comment.