diff --git a/.github/draft_release.yml b/.github/draft_release.yml new file mode 100644 index 0000000..ae1b8e5 --- /dev/null +++ b/.github/draft_release.yml @@ -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 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..34b2a2c --- /dev/null +++ b/.github/workflows/deploy.yml @@ -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 }} diff --git a/.github/workflows/release-draft.yml b/.github/workflows/release-draft.yml new file mode 100644 index 0000000..94c3948 --- /dev/null +++ b/.github/workflows/release-draft.yml @@ -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 }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 82f6373..0000000 --- a/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: node_js -node_js: -- '7' -- '8' -- '9' -- '10' -- '11' -- '12' -deploy: - provider: npm - email: dx@bandwidth.com - on: - tags: true - repo: Bandwidth/node-numbers - api_key: - secure: "blOgkbLYhXNsbdNr57hhsNAgAjD0/4aCPgDWdfF3ku+Vq56IfatXOSJtopj9A5unINFfTWuDH2KGyt8C1oTDjFGLzZw8D11mHt2ewfH5lp77u93JIvaACDrrbiGvrNyDkSlYeMvVoUPU0sSwUmWomdiwzYLwBAXWx5ZRnez3kxw7e7fu29dI3uM5OWKD0nrGeUSJ8Lgf4d1e8Vvgb4ZKGLSz2HpXrFqabjHQ7B0ShDbxt5biAaxM0lbPTU15iS7qjrWn5kdmNe8mhrPjRRSYfkMMYfVZiV/S4SDKrbQ7dgwEJn3Kf/1EeYG/QGkZ+S5vSxRw2IEakB3tTKcJqK+SWgpckCYa7z8hox2enYQXJkUqmBMZKcixB6CCwRnBaAZwCIZGmDtnN7cm2TOXPFmHmjhaqBTgMhw1RsanL+ewJB6aYBGazC9B7aiQSxyEcmP465Ez318etjQiG1+AvCGvgnYvN6ZO4PNmsk+kA59+43rhfYCyN2oTVpZJ+Es/A2eMyQDGidpxwEDW5buT4wOpFymcBVeR+EBOaLWapSZMSt5EtsZ1B+Whn4mRZDgvblePuFh+TEUnzvZz4N7J6vi7nFnu4Qkxkqa9X3du6SGlzxgjxX4y+5YrInDMcR8BeiJugk7/iSSuV7mYRsdFd9gQTyIw9Lvf6pgtV09kWROgA6I="