forked from PrairieLearn/PrairieLearn
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (42 loc) · 1.44 KB
/
Copy pathrelease.yml
File metadata and controls
47 lines (42 loc) · 1.44 KB
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
name: Release
# We want this workflow to run on master, but only after we've finished the
# main CI workflow. This ensures that, for instance, if integration tests
# fail on master, we don't accidentally publish broken versions of pacakges.
#
# See the `if` condition on the `release` job for the second half of this logic.
on:
workflow_run:
workflows:
- CI
branches:
- master
types:
- completed
jobs:
release:
name: Release
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
- name: Setup Node.js 16.x
uses: actions/setup-node@v3.5.0
with:
node-version: 16.x
- name: Install Dependencies
run: yarn --frozen-lockfile
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
# This invokes the `release` script in `package.json`, which will build
# all the packages and then invoke `changeset publish`.
publish: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# This token was generated by Nathan Walters on 8 February 2022.
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}