-
Notifications
You must be signed in to change notification settings - Fork 8
52 lines (51 loc) · 1.63 KB
/
post-release.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
on:
release:
types:
- published
workflow_dispatch:
jobs:
bump-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v2
with:
node-version: '16'
- run: echo "nextVersion=$(npm version --no-git-tag minor)" >> $GITHUB_ENV
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
id: cpr
with:
token: ${{ secrets.GIT_ACCESS_TOKEN }}
branch: feature/bump-core-ui-version-to-${{ env.nextVersion }}
commit-message: Bump core-ui version to ${{ env.nextVersion }}
title: Bump core-ui version to ${{ env.nextVersion }}
body: ''
base: ${{ github.event.repository.default_branch }}
- uses: actions/github-script@v5
if: ${{ steps.cpr.outputs.pull-request-number }}
with:
github-token: ${{secrets.GIT_ACCESS_TOKEN}}
script: |
github.rest.issues.createComment({
issue_number: '${{ steps.cpr.outputs.pull-request-number }}',
owner: context.repo.owner,
repo: context.repo.repo,
body: '/approve'
})
publish-npm:
runs-on: ubuntu-latest
environment: npmjs
steps:
- uses: actions/checkout@v3
# Setup .npmrc file to publish to npmjs.org
- uses: actions/setup-node@v3
with:
node-version: '16'
registry-url: 'https://registry.npmjs.org'
- run: npm install
- run: npm run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}