Skip to content

Publish @bitgo-beta #421

Publish @bitgo-beta

Publish @bitgo-beta #421

Workflow file for this run

name: Publish @bitgo-beta
on:
workflow_dispatch:
# push:
# branches:
# - master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
publish:
name: Publish Release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install BitGoJS
run: yarn install --with-frozen-lockfile
- name: Set Environment Variable for Alpha
if: github.ref != 'refs/heads/master' # only publish changes if on feature branches
run: |
echo "preid=alpha" >> $GITHUB_ENV
- name: Set Environment Variable for Beta
if: github.ref == 'refs/heads/master' # only publish changes if on master branches
run: |
echo "preid=beta" >> $GITHUB_ENV
- name: Configure Git & NPM
run: |
git config --global user.name 'Git bot'
git config --global user.email '[email protected]'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git checkout -b ${{ env.preid }}-$(git rev-parse --short HEAD)
echo "email=${{ secrets.BETA_EMAIL }}" > .npmrc
echo "@bitgo-beta:registry=https://registry.npmjs.org" >> .npmrc
echo "//registry.npmjs.org/:_authToken=${{ secrets.BETA_TOKEN }}" >> .npmrc
echo "//registry.npmjs.org/:always-auth=true" >> .npmrc
- name: Prepare Release
run: |
rm -rfd ./modules/web-demo
rm -rfd ./modules/express
npx ts-node ./scripts/prepare-release.ts ${{ env.preid }}
- name: Rebuild packages
run: yarn
- name: Commit Local Changes
run: git commit -am "Auto updated ${{ env.preid }} branch" --no-verify || echo "No changes to commit"
- name: Lerna Publish
run: yarn lerna publish from-package --preid ${{ env.preid }} --dist-tag ${{ env.preid }} --force-publish --yes --loglevel silly
- name: Verify Publish
run: npx ts-node ./scripts/verify-release.ts ${{ env.preid }}