forked from sst/sst
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (58 loc) · 1.88 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
68
name: Release
on:
push:
branches:
- master
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
# https://github.com/actions/checkout
uses: actions/checkout@v2
- name: Setup Node.js
# https://github.com/actions/setup-node
uses: actions/setup-node@v2
with:
node-version: 16.x
- uses: actions/cache@v2
id: yarn-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn --frozen-lockfile --ignore-scripts
- name: Create Release Pull Request or Publish to npm
id: changesets
# https://github.com/changesets/action
uses: changesets/action@v1
with:
createGithubReleases: false
publish: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: View outputs
run: echo ${{join(steps.changesets.outputs.*, ' ')}}
- name: Aggregate
id: aggregate
if: steps.changesets.outputs.published == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
node ./.changeset/aggregate.mjs
- name: Create Release
if: steps.changesets.outputs.published == 'true'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.aggregate.outputs.version }}
release_name: ${{ steps.aggregate.outputs.version }}
body: ${{ steps.aggregate.outputs.notes }}
draft: false
prerelease: false