-
Notifications
You must be signed in to change notification settings - Fork 28
40 lines (40 loc) · 1.72 KB
/
release.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
name: Release Monorepo Packages
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v2
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
# Defaults to the user or organization that owns the workflow file
scope: '@zkopru'
- name: Git Identity
run: |
git config --global user.name '${{ github.actor }}'
git config --global user.email '${{ github.actor }}@users.noreply.github.com'
git remote set-url origin https://x-access-token:${GH_PERSONAL_ACCESS_TOKEN}@github.com/$GITHUB_REPOSITORY
env:
GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
- run: npm config set access public
- run: yarn
- run: yarn build
- run: yarn lerna version ${{ github.event.release.tag_name }} --yes --no-git-tag-version
- run: yarn version --new-version ${{ github.event.release.tag_name }} --no-git-tag-version
- run: git add . && git commit -m "chore(release):${{ github.event.release.tag_name }}" -n
- run: echo //registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN} > .npmrc
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
- run: yarn lerna publish from-package --yes --no-verify-access
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
- run: git checkout -b release/${{ github.event.release.tag_name }}
- run: git push origin release/${{ github.event.release.tag_name }}
- run: git checkout -b main
- run: git pull origin main --rebase
- run: git push origin main