-
Notifications
You must be signed in to change notification settings - Fork 273
38 lines (36 loc) · 1.36 KB
/
publish.yml
File metadata and controls
38 lines (36 loc) · 1.36 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
name: Publish Package to npmjs
on:
release:
types: [published]
permissions:
id-token: write # Required for OIDC
contents: read
jobs:
build:
runs-on: ubuntu-latest
container: ghcr.io/sanchuanhehe/harmony-next-pipeline-docker/harmonyos-ci-image:latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- name: Configure git safe.directory
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git submodule foreach --recursive 'git config --global --add safe.directory "$toplevel/$sm_path"'
- uses: oven-sh/setup-bun@v2
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v6
with:
node-version: 24
registry-url: 'https://registry.npmjs.org'
- run: bun install --frozen-lockfile
- name: Verify Harmony build tools
run: |
command -v hvigorw >/dev/null 2>&1 || (echo "Missing hvigorw in the Harmony container image." >&2; exit 1)
command -v ohpm >/dev/null 2>&1 || (echo "Missing ohpm in the Harmony container image." >&2; exit 1)
- name: Build Harmony HAR
run: npm run build:harmony-har -- --build-mode release
- name: Verify Harmony HAR artifact
run: test -f harmony/pushy.har
- run: npm publish --provenance --access public