-
Notifications
You must be signed in to change notification settings - Fork 208
81 lines (69 loc) · 2.08 KB
/
ci.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: RPG CI
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm i
- run: npm test
build_and_publish:
needs: tests
if: github.ref == 'refs/heads/v4'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
- run: npm i
- run: npm run build
- name: "Version and publish"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor}}@users.noreply.github.com"
npm set //registry.npmjs.org/:_authToken=$NPM_TOKEN
npx lerna version --conventional-commits --no-push --yes
npx lerna publish from-git --no-private --loglevel=verbose --yes
starter_repo_update_dependencies:
needs: build_and_publish
runs-on: ubuntu-latest
steps:
- name: Checkout the starter repository
run: git clone https://github.com/rpgjs/starter
- name: Change to the starter directory
run: cd starter
- name: Install npm-check-updates globally
run: npm i npm-check-updates -g
- name: Run ncu to update dependencies
run: ncu -u
- run: npm i
- name: Configure Git User
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor}}@users.noreply.github.com"
- name: Commit the updated package.json
run: |
git add package*.json
git commit -m "Update dependencies to latest version"
git push https://[email protected]/rpgjs/starter.git