-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (55 loc) · 2.03 KB
/
pr-workflow.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Pull request
on:
pull_request:
branches: [main]
types: [opened, synchronize, reopened]
jobs:
check_version:
name: "Check package.json version"
uses: whereby/github-actions/.github/workflows/check_if_version_is_incremented.yml@1.0.0
with:
source_dir: src
test:
name: Format, Lint, and Test
runs-on: ${{ vars.PLATFORM }}
env:
GITHUB_TOKEN: ${{ secrets.WHEREBY_PUBLISH_GITHUB_PACKAGES }}
steps:
- uses: actions/checkout@v4
- name: Prepare repository
run: git fetch --unshallow --tags
- name: Setup npmrc
run: echo "//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}" >> ~/.npmrc
- name: Use Node.js ${{ vars.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ vars.NODE_VERSION }}
- name: Install
run: yarn install --frozen-lockfile
- name: Format
run: yarn format:check
- name: Lint
run: yarn lint
- name: Unit Test
run: yarn test:unit
canary_release:
name: Create canary release
needs: [check_version, test]
runs-on: ${{ vars.PLATFORM }}
env:
GITHUB_TOKEN: ${{ secrets.WHEREBY_PUBLISH_GITHUB_PACKAGES }}
NPM_TOKEN: ${{ secrets.WHEREBY_PUBLISH_GITHUB_PACKAGES }}
steps:
- uses: actions/checkout@v4
- name: Prepare repository
run: git fetch --unshallow --tags
- name: Setup npmrc
run: echo "//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}" >> ~/.npmrc
- name: Use Node.js ${{ vars.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ vars.NODE_VERSION }}
- name: Install
run: yarn install --frozen-lockfile
- name: Create Release
run: yarn run auto shipit