-
Notifications
You must be signed in to change notification settings - Fork 194
61 lines (52 loc) · 1.97 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
name: Release
on:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
release:
name: Release
runs-on: ubuntu-latest
environment: production
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16"
- name: Setup PNPM
# You may pin to the exact commit or the version.
# uses: pnpm/action-setup@646cdf48217256a3d0b80361c5a50727664284f2
uses: pnpm/action-setup@v2.2.4
with:
# Version of PNPM to install
version: 6.3.0
# Where to store PNPM files
# dest: # optional, default is ~/setup-pnpm
# If specified, run `pnpm install`
# run_install: true
- name: Cache pnpm modules
uses: actions/cache@v3
env:
cache-name: cache-pnpm-modules
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
restore-keys: ${{ runner.os }}-${{ env.cache-name }}-
- name: Install dependencies
run: pnpm install
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# - name: Send a Slack notification if a publish happens
# if: steps.changesets.outputs.published == 'true'
# # You can do something when a publish happens.
# run: my-slack-bot send-notification --message "A new version of ${GITHUB_REPOSITORY} was published!"