-
Notifications
You must be signed in to change notification settings - Fork 19
60 lines (47 loc) · 1.41 KB
/
ci.yaml
File metadata and controls
60 lines (47 loc) · 1.41 KB
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
on:
repository_dispatch:
types: [spec_release]
push:
branches:
- main
name: Build & release
jobs:
build-and-release:
runs-on: ubuntu-latest
name: Release
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 10
run_install: false
- name: Install yq via apt
run: sudo apt install -y yq
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Download specification
run: curl -L -o openapi.yaml https://vrchat.community/openapi.yaml
- name: Update version
run: |
version=$(yq '.info.version' openapi.yaml | tr -d '"')
# pnpm version "${VERSION}-next.$(date +%s)" --no-git-tag-version
major=$(echo $version | cut -d. -f1)
minor=$(echo $version | cut -d. -f2)
patch=$(echo $version | cut -d. -f3)
version="$((major+1)).$minor.$patch"
pnpm version $version --no-git-tag-version
- name: Build
run: pnpm build
- name: Release
run: |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
pnpm publish --no-git-checks
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}