Skip to content
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 21 additions & 128 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,85 +20,34 @@ on:
description: Perform a dry run
required: true
default: true
pull_request:
types:
- opened
- synchronize

jobs:
npm:
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
contents: read

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup node.js for NPM
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 14
node-version: 20
cache: 'yarn'
registry-url: 'https://registry.npmjs.org'
scope: '@customerio'

- 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: Build
run: |
yarn build

- name: Publish (dry-run)
if: ${{ github.event.inputs.dry-run == 'true' }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
for package in core browser node; do
pushd packages/$package
npm publish --dry-run
popd
done

- name: Publish
if: ${{ github.event.inputs.dry-run == 'false' }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
for package in core browser node; do
pushd packages/$package
npm publish
popd
done

github:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- 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 npm 11.5.1+ for OIDC support
run: npm install -g npm@latest

- name: Install
run: |
Expand All @@ -107,88 +56,32 @@ jobs:
- name: Bump core
run: |
cd packages/core
yarn version ${{ github.event.inputs.version }}
yarn version 0.0.0-test-oidc --no-git-tag-version
# yarn version ${{ github.event.inputs.version }}

- name: Bump browser
run: |
cd packages/browser
yarn version ${{ github.event.inputs.version }}
yarn version 0.0.0-test-oidc --no-git-tag-version
# yarn version ${{ github.event.inputs.version }}
yarn run build-prep

- name: Bump node
run: |
cd packages/node
yarn version ${{ github.event.inputs.version }}
yarn version 0.0.0-test-oidc
# yarn version ${{ github.event.inputs.version }}

- name: Build
run: |
yarn build

- name: Publish (dry-run)
if: ${{ github.event.inputs.dry-run == 'true' }}
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
for package in core browser node; do
pushd packages/$package
npm publish --dry-run
popd
done

- name: Publish
if: ${{ github.event.inputs.dry-run == 'false' }}
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
for package in core browser node; do
pushd packages/$package
npm publish
echo "Publishing $package"
npm publish --dry-run --tag test-oidc
popd
done

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: Show commit (dry-run)
if: ${{ github.event.inputs.dry-run == 'true' }}
run: |
git commit -am "Update version"
git show

- name: Push changes
if: ${{ github.event.inputs.dry-run == 'false' }}
run: |
git commit -am "Update version"
git push
Loading