-
Notifications
You must be signed in to change notification settings - Fork 3.3k
67 lines (58 loc) · 1.74 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
66
67
name: Release
on:
push:
branches:
- main
permissions: {}
jobs:
release:
permissions:
contents: write # to create release (changesets/action)
pull-requests: write # to create pull request (changesets/action)
name: ${{ matrix.channel }}
runs-on: ubuntu-latest
strategy:
max-parallel: 1
matrix:
channel:
- latest
- dev
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: 20.x
cache: yarn
registry-url: https://registry.npmjs.org
key: node20
- name: Install dependencies
run: yarn
- name: Prepare release
run: yarn prerelease
# https://github.com/changesets/action
- name: Create release pull request or Publish to npm
if: matrix.channel == 'latest'
uses: changesets/action@v1
with:
# defined in package.json#scripts
version: yarn changesetversion
publish: yarn changeset publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
YARN_ENABLE_IMMUTABLE_INSTALLS: false
# https://github.com/atlassian/changesets/blob/master/docs/snapshot-releases.md
- name: Release to @dev channel
if: matrix.channel == 'dev'
run: |
yarn changeset version --snapshot
yarn changeset publish --tag dev
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}