mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-09 00:36:41 +02:00
add commenting release workflow
This commit is contained in:
55
.github/workflows/comment.yml
vendored
55
.github/workflows/comment.yml
vendored
@@ -6,13 +6,13 @@ on:
|
|||||||
types:
|
types:
|
||||||
- created
|
- created
|
||||||
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
rebase:
|
rebase:
|
||||||
|
name: rebase
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.event.issue.pull_request != '' && startsWith(github.event.comment.body, '/rebase')
|
if: |
|
||||||
|
github.event.issue.pull_request &&
|
||||||
|
startsWith(github.event.comment.body, '/rebase')
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
@@ -21,3 +21,50 @@ jobs:
|
|||||||
|
|
||||||
- name: Rebase PR
|
- name: Rebase PR
|
||||||
uses: cirrus-actions/rebase@1.3.1
|
uses: cirrus-actions/rebase@1.3.1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
release_next:
|
||||||
|
name: release:next
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: |
|
||||||
|
github.event.issue.pull_request &&
|
||||||
|
github.event.sender.login === 'ianstormtaylor' &&
|
||||||
|
startsWith(github.event.comment.body, '/release:next')
|
||||||
|
steps:
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Setup node
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: 12.x
|
||||||
|
registry-url: https://registry.npmjs.org
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: yarn
|
||||||
|
|
||||||
|
- name: Prepare release
|
||||||
|
run: yarn prerelease
|
||||||
|
|
||||||
|
# https://github.com/atlassian/changesets/blob/master/docs/snapshot-releases.md
|
||||||
|
- name: Release to @pr channel
|
||||||
|
run: |
|
||||||
|
yarn changeset version --snapshot
|
||||||
|
yarn changeset publish --tag pr
|
||||||
|
env:
|
||||||
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Get released version
|
||||||
|
id: version
|
||||||
|
run: echo ::set-output name=version::$(node -p "require('./packages/slate/package.json').version")
|
||||||
|
|
||||||
|
- name: Create comment
|
||||||
|
uses: peter-evans/create-or-update-comment@v1
|
||||||
|
with:
|
||||||
|
issue-number: ${{ github.event.issue.number }}
|
||||||
|
body: |
|
||||||
|
A new release has been made for this pull request. You can install it with `yarn add slate@${{ steps.version.outputs.version }}`.
|
||||||
|
Reference in New Issue
Block a user