-
Notifications
You must be signed in to change notification settings - Fork 67
70 lines (57 loc) · 1.74 KB
/
Copy pathpublish.yml
File metadata and controls
70 lines (57 loc) · 1.74 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
name: Publish
on:
workflow_dispatch:
inputs:
dryRun:
description: 'Set to true to perform a dry run'
required: false
default: 'true'
permissions:
id-token: write
contents: read
jobs:
verify-and-publish:
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Run ESLint (JS/TS check)
run: yarn lint
- name: Typecheck files
run: yarn typecheck
- name: Run clang-format (C/C++ check)
run: yarn lint-clang
- name: Run android lint (Kotlin/Java/Groovy check)
run: yarn lint:android
- name: Run unit tests
run: yarn test --maxWorkers=2 --coverage
- name: Build package
run: npm pack
- name: Get metadata
id: meta
run: |
NAME=$(jq -r .name package.json)
VERSION=$(jq -r .version package.json)
FILENAME="${NAME}-${VERSION}.tgz"
echo "PACKAGE_NAME=$FILENAME" >> $GITHUB_OUTPUT
echo "Artifact filename: $FILENAME"
- name: Upload NPM tarball as artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.meta.outputs.PACKAGE_NAME }}
path: ${{ steps.meta.outputs.PACKAGE_NAME }}
overwrite: true
if-no-files-found: error
- name: Publish package (dry-run)
if: ${{ github.event.inputs.dryRun == 'true' }}
run: |
echo "Dry run enabled — skipping actual publish"
npm publish --dry-run
- name: Publish package
if: ${{ github.event.inputs.dryRun != 'true' }}
run: |
echo "Publishing package..."
npm publish