-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (73 loc) · 2.34 KB
/
Copy pathpublish-plugin-api.yml
File metadata and controls
90 lines (73 loc) · 2.34 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Publish Plugin API
on:
push:
tags:
- "v*.*.*"
permissions:
contents: read
id-token: write
concurrency:
group: publish-plugin-api-${{ github.ref }}
cancel-in-progress: false
jobs:
publish:
name: Publish npm packages and crate
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22.14.0"
registry-url: "https://registry.npmjs.org"
- name: Use npm with trusted publishing support
run: |
npm install -g npm@^11.5.1
node --version
npm --version
- name: Setup Rust
uses: dtolnay/rust-toolchain@4be7066ada62dd38de10e7b70166bc74ed198c30
with:
toolchain: 1.97.0
- name: Verify release tag
run: node scripts/sync-versions.mjs && node scripts/verify-release-version.mjs
- name: Ensure generated versions are committed
run: git diff --exit-code
- name: Check existing published versions
id: published
run: node scripts/check-release-availability.mjs
- name: Verify cargo publish credentials
if: steps.published.outputs.crate_published != 'true'
run: test -n "$CARGO_REGISTRY_TOKEN"
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
- name: Test Rust crate
run: cargo test
- name: Build SDK
working-directory: sdk
run: |
npm install --no-package-lock
npm run build
npm pack --dry-run
- name: Test pack CLI
working-directory: pack
run: |
npm ci
npm test
npm pack --dry-run
- name: Publish SDK to npm
if: steps.published.outputs.sdk_published != 'true'
working-directory: sdk
run: npm publish --access public
- name: Publish pack CLI to npm
if: steps.published.outputs.pack_published != 'true'
working-directory: pack
run: npm publish --access public
- name: Publish Rust crate
if: steps.published.outputs.crate_published != 'true'
run: |
cargo publish --dry-run --manifest-path Cargo.toml
cargo publish --manifest-path Cargo.toml
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}