-
Notifications
You must be signed in to change notification settings - Fork 311
73 lines (68 loc) · 2.44 KB
/
Copy pathrelease.yml
File metadata and controls
73 lines (68 loc) · 2.44 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
61
62
63
64
65
66
67
68
69
70
71
72
73
# SPDX-FileCopyrightText: 2024 LiveKit, Inc.
#
# SPDX-License-Identifier: Apache-2.0
name: Release
on:
push:
branches:
- main
- 0.x
concurrency: ${{ github.workflow }}-${{ github.ref }}
permissions:
id-token: write # Required for OIDC
contents: write # Required to create GH releases
pull-requests: write # Required to interact with PRs
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
lfs: true
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0
- name: Use Node.js 20
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 24
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
# npm trusted publishing cannot publish a package for the first time. New packages must be
# created on npm before release CI can publish subsequent versions with OIDC.
- name: Verify all packages exist on npm
run: |
MISSING=()
for pkg in $(pnpm -r --silent exec -- node -e "
const p = require('./package.json');
if (!p.private) process.stdout.write(p.name + '\n');
"); do
if ! npm view "$pkg" > /dev/null 2>&1; then
MISSING+=("$pkg")
fi
done
if [ ${#MISSING[@]} -gt 0 ]; then
echo "::error::The following packages are not yet published on npm:"
for pkg in "${MISSING[@]}"; do
echo "::error:: - $pkg"
done
exit 1
fi
echo "All packages exist on npm."
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@63a615b9cd06ba9a3e6d13796c7fbcb080a60a0b # v1.8.0
with:
publish: pnpm ci:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build docs
if: steps.changesets.outputs.published == 'true'
run: pnpm doc
- name: S3 upload
if: steps.changesets.outputs.published == 'true'
run: aws s3 cp docs/ s3://livekit-docs/agents-js --recursive
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_DEPLOY_AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_DEPLOY_AWS_API_SECRET }}
AWS_DEFAULT_REGION: 'us-east-1'