Skip to content

Release

Release #23

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
version:
type: choice
description: The new version to build and publish
required: true
default: 'patch'
options:
- major
- minor
- patch
jobs:
npm:
runs-on: ubuntu-latest
strategy:
matrix:
package:
- browser
- core
- node
steps:
- uses: actions/checkout@v3
- name: Setup node.js for NPM
uses: actions/setup-node@v3
with:
node-version: 14
cache: 'yarn'
registry-url: 'https://registry.npmjs.org'
scope: '@customerio'
- name: Install & Build
run: |
yarn install --frozen-lockfile
yarn build
- name: Publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
cd packages/${{ matrix.package }}
npm version ${{ github.event.inputs.version }}
npm publish
github:
runs-on: ubuntu-latest
strategy:
matrix:
package:
- browser
- core
- node
steps:
- uses: actions/checkout@v3
- name: Setup node.js for GitHub
uses: actions/setup-node@v3
with:
node-version: 14
cache: 'yarn'
registry-url: 'https://npm.pkg.github.com'
scope: '@customerio'
- name: Install & Build
run: |
yarn install --frozen-lockfile
yarn build
- name: Publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd packages/${{ matrix.package }}
npm version ${{ github.event.inputs.version }}
npm publish
commit:
runs-on: ubuntu-latest
needs: [npm, github]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set Git Identity
run: |
git config --global user.name "Customer.io"
git config --global user.email "win@customer.io"
- name: Install
run: |
yarn install --frozen-lockfile
- name: Bump core
run: |
cd packages/core
yarn version ${{ github.event.inputs.version }}
- name: Bump browser
run: |
cd packages/browser
yarn version ${{ github.event.inputs.version }}
yarn run build-prep
- name: Bump node
run: |
cd packages/node
yarn version ${{ github.event.inputs.version }}
- name: Push changes
run: |
git commit -am "Update version"
git push