-
-
Notifications
You must be signed in to change notification settings - Fork 796
62 lines (60 loc) · 2 KB
/
canary.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
name: Canary Release
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
publish-canary:
name: Publish Canary
runs-on: ubuntu-latest
if: contains(github.actor, 'dependabot') == false
steps:
- name: Checkout Master
uses: actions/checkout@v1
- name: Use Node
uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache Yarn
uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-14-15-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-14-15-yarn-
- name: Install Dependencies using Yarn
run: yarn install && git checkout yarn.lock
- name: Release Canary
id: canary
uses: 'kamilkisiela/release-canary@master'
with:
npm-token: ${{ secrets.NODE_AUTH_TOKEN }}
npm-script: 'yarn release:canary'
changesets: true
- name: Publish a message
if: steps.canary.outputs.released
uses: 'kamilkisiela/pr-comment@master'
with:
message: |
The latest changes of this PR are available as alpha in npm (based on the declared `changesets`):
```
${{ steps.canary.outputs.changesetsPublishedPackages}}
```
bot-token: ${{ secrets.GH_API_TOKEN }}
bot: 'theguild-bot'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish a empty message
if: steps.canary.outputs.released == 'false'
uses: 'kamilkisiela/pr-comment@master'
with:
message: |
The latest changes of this PR are not available as alpha, since there are no linked `changesets` for this PR.
bot-token: ${{ secrets.GH_API_TOKEN }}
bot: 'theguild-bot'
github-token: ${{ secrets.GITHUB_TOKEN }}