-
-
Notifications
You must be signed in to change notification settings - Fork 98
65 lines (57 loc) · 2 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Release
# keep the changelog up to date on every commit to main
on:
push:
branches:
- main
- next
env:
CI: true
jobs:
publish:
name: Publish
runs-on: ubuntu-22.04
steps:
- name: Creating .npmrc
run: |
cat << EOF > "$HOME/.npmrc"
email=$NPM_EMAIL
name=$NPM_NAME
//registry.npmjs.org/:_authToken=$NPM_TOKEN
EOF
env:
NPM_EMAIL: ${{ secrets.NPM_EMAIL }}
NPM_NAME: ${{ secrets.NPM_NAME }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Checkout source
uses: actions/checkout@master
with:
ref: ${{ github.ref }}
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16.17.0
- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
with:
version: 7
- name: Install dependencies
run: pnpm install
- name: Set Git Identity
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/$GITHUB_REPOSITORY
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release Pull Request or Deploy
uses: changesets/action@v1
with:
version: pnpm run version
publish: pnpm run release
title: '📦 Version Update'
commit: '📦 v{VERSION}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}