-
Notifications
You must be signed in to change notification settings - Fork 13
50 lines (44 loc) · 1.36 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
40
41
42
43
44
45
46
47
48
49
50
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: 20
- name: Install dependencies
run: yarn install
- name: Build package
run: |
cd packages/repluggable
yarn build
- name: Run tests
run: |
cd packages/repluggable
yarn test
- name: Bump version
run: |
cd packages/repluggable
git reset --hard
echo yarn version "0.0.0-pr$PR_ID.$BUILD_NUMBER"
yarn version "0.0.0-pr$PR_ID.$BUILD_NUMBER"
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: |
cd packages/repluggable
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 }}