-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (70 loc) · 2.04 KB
/
release.yml
File metadata and controls
84 lines (70 loc) · 2.04 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
name: release
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write
id-token: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: uapi-cli/go.mod
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
- name: Test Go CLI
working-directory: uapi-cli
run: go test ./...
- name: Build release binaries
working-directory: uapi-cli-npm
run: npm run build:release
- name: Pack wrapper package
working-directory: uapi-cli-npm
run: npm pack --dry-run
- name: Pack platform packages
shell: bash
run: |
set -euo pipefail
for dir in \
uapi-cli-win32-x64 \
uapi-cli-linux-x64 \
uapi-cli-linux-arm64 \
uapi-cli-darwin-x64 \
uapi-cli-darwin-arm64
do
(cd "$dir" && npm pack --dry-run)
done
- name: Smoke test npm wrapper
run: node ./uapi-cli-npm/bin/uapi.js schema post-image-ocr --format json > /tmp/uapi-schema.json
- name: Smoke test Python wrapper
run: python ./uapi_llm_cli.py discover ocr > /tmp/uapi-llm.json
- name: Publish npm packages
if: startsWith(github.ref, 'refs/tags/')
shell: bash
run: |
set -euo pipefail
for dir in \
uapi-cli-win32-x64 \
uapi-cli-linux-x64 \
uapi-cli-linux-arm64 \
uapi-cli-darwin-x64 \
uapi-cli-darwin-arm64 \
uapi-cli-npm
do
(cd "$dir" && npm publish --access public --provenance)
done
- name: Create GitHub release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true