-
Notifications
You must be signed in to change notification settings - Fork 274
65 lines (52 loc) · 2.14 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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: 14
- 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 }}