-
-
Notifications
You must be signed in to change notification settings - Fork 100
69 lines (67 loc) · 2.54 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
63
64
65
66
67
68
69
name: Canary Release
on:
pull_request:
branches:
- master
jobs:
publish-canary:
name: Publish Canary
runs-on: ubuntu-latest
if: github.event.pull_request.head.repo.full_name == github.repository
steps:
- name: Checkout Master
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node
uses: actions/setup-node@v2
with:
node-version: '16.x'
- name: Configure Git Credentials
run: |
git config --global user.email "theguild-bot@users.noreply.github.com"
git config --global user.name "theguild-bot"
echo "machine github.com login theguild-bot password ${{secrets.GH_API_TOKEN}}" > ~/.netrc
- name: Setup NPM credentials
run: echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" >> ~/.npmrc
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
- name: Cache Yarn
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-16-8-16-node-modules-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-16-8-16-node-modules-${{ hashFiles('yarn.lock') }}
${{ runner.os }}-16-8-16-node-modules-
- name: Install Dependencies using Yarn
run: yarn install && git checkout yarn.lock && yarn patch-package
- name: Release Canary
id: canary
uses: 'kamilkisiela/release-canary@master'
if: github.repository == 'dotansimha/graphql-eslint'
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 }}