11name : Canary Release
22
33on :
4- push :
5- branches :
6- - master
74 pull_request :
85 branches :
96 - master
7+
108jobs :
119 publish-canary :
1210 name : Publish Canary
13- timeout-minutes : 10
1411 runs-on : ubuntu-latest
15- if : contains( github.actor, 'renovate') == false
12+ if : github.event.pull_request.head.repo.full_name == github.repository
1613 steps :
1714 - name : Checkout Master
1815 uses : actions/checkout@v1
1916 - name : Use Node
2017 uses : actions/setup-node@v1
2118 with :
2219 node-version : ' 14.x'
20+ - name : Configure Git Credentials
21+ run : |
22+ git config --global user.email "[email protected] " 23+ git config --global user.name "theguild-bot"
24+ echo "machine github.com login theguild-bot password ${{secrets.GH_API_TOKEN}}" > ~/.netrc
25+ - name : Setup NPM credentials
26+ run : echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" >> ~/.npmrc
27+ env :
28+ NODE_AUTH_TOKEN : ${{ secrets.NODE_AUTH_TOKEN }}
2329 - name : Get yarn cache
2430 id : yarn-cache
2531 run : echo "::set-output name=dir::$(yarn cache dir)"
@@ -32,26 +38,32 @@ jobs:
3238 ${{ runner.os }}-14-yarn-
3339 - name : Install Dependencies using Yarn
3440 run : yarn install --ignore-engines && git checkout yarn.lock
35- - name : Build
36- run : yarn build
37-
3841 - name : Release Canary
3942 id : canary
4043 uses : ' kamilkisiela/release-canary@master'
41- if : github.repository == 'dotansimha/graphql-code-generator'
4244 with :
4345 npm-token : ${{ secrets.NODE_AUTH_TOKEN }}
44- npm-script : ' release:canary'
46+ npm-script : ' yarn release:canary'
47+ changesets : true
4548 - name : Publish a message
4649 if : steps.canary.outputs.released
4750 uses : ' kamilkisiela/pr-comment@master'
4851 with :
4952 message : |
50- The latest changes of this PR are available as alpha in npm: `${{ steps.canary.outputs.version }}`
51-
52- Quickly update your package.json by running:
53+ The latest changes of this PR are available as alpha in npm (based on the declared `changesets`):
5354
54- npx match-version @graphql-codegen ${{ steps.canary.outputs.version }}
55+ ```
56+ ${{ steps.canary.outputs.changesetsPublishedPackages}}
57+ ```
58+ bot-token : ${{ secrets.GH_API_TOKEN }}
59+ bot : ' theguild-bot'
60+ github-token : ${{ secrets.GITHUB_TOKEN }}
61+ - name : Publish a empty message
62+ if : steps.canary.outputs.released == 'false'
63+ uses : ' kamilkisiela/pr-comment@master'
64+ with :
65+ message : |
66+ The latest changes of this PR are not available as alpha, since there are no linked `changesets` for this PR.
5567 bot-token : ${{ secrets.GH_API_TOKEN }}
5668 bot : ' theguild-bot'
5769 github-token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments