-
Notifications
You must be signed in to change notification settings - Fork 13
44 lines (44 loc) · 1.23 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
41
42
43
44
name: Release
on:
workflow_run:
workflows: ['Tests', 'Storybook Tests']
branches: [main]
types:
- completed
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 'lts/*'
- name: Set yarn version
run: yarn set version 4.1.1
- name: Install dependencies
run: yarn install
- name: Run pre-publish script
run: yarn prepublish
- name: Commit changes made by the prepublish script
run: |
git config --global user.name 'GitHub Action'
git config --global user.email 'action@github.com'
git add .
git commit -m "chore: run prepublish script" || true
git push origin main
- name: Build
run: yarn build
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}