-
Notifications
You must be signed in to change notification settings - Fork 13
39 lines (35 loc) · 1.18 KB
/
pr.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
name: Pull Request Build
on: pull_request
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 14
- run: yarn
- run: yarn build
- run: yarn test
- name: Bump version
run: |
git reset --hard
echo yarn version --prerelease --preid "pr$PR_ID.$BUILD_NUMBER" --no-git-tag-version
yarn version --prerelease --preid "pr$PR_ID.$BUILD_NUMBER" --no-git-tag-version
git status -vv
yarn build
git add . || true
git commit -m "Bump prerelease version" || true
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
PR_ID: ${{ github.event.number }}
BUILD_NUMBER: ${{ github.run_number }}
- name: npm publish
run: |
echo PR package tag is [pr$PR_ID.$BUILD_NUMBER]
npm config set //registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN
npm publish --tag "pr$PR_ID.$BUILD_NUMBER"
env:
NPM_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
PR_ID: ${{ github.event.number }}
BUILD_NUMBER: ${{ github.run_number }}