-
Notifications
You must be signed in to change notification settings - Fork 15
83 lines (69 loc) · 2.07 KB
/
snapshot-avm.yml
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: Publish avm snapshot
on:
workflow_call:
inputs:
ref:
description: "GitHub ref to checkout to"
type: string
default: "master"
outputs:
version:
description: "@fluencelabs/avm version"
value: ${{ jobs.snapshot.outputs.version }}
env:
FORCE_COLOR: true
jobs:
snapshot:
name: "Publish avm"
runs-on: ubuntu-latest
timeout-minutes: 60
outputs:
version: "${{ steps.snapshot.outputs.version }}"
permissions:
contents: read
id-token: write
steps:
- name: Checkout AquaVM
uses: actions/checkout@v4
with:
repository: fluencelabs/aquavm
ref: ${{ inputs.ref }}
- name: Download air-interpreter-wasm binary
uses: actions/download-artifact@v3
with:
name: air-interpreter-wasm
path: avm/client/dist/
- run: mv air_interpreter_server.wasm avm.wasm
working-directory: avm/client/dist
- name: Import secrets
uses: hashicorp/[email protected]
with:
url: https://vault.fluence.dev
path: jwt/github
role: ci
method: jwt
jwtGithubAudience: "https://github.com/fluencelabs"
jwtTtl: 300
exportToken: false
secrets: |
kv/npm-registry/basicauth/ci token | NODE_AUTH_TOKEN
- name: Setup node with self-hosted npm registry
uses: actions/setup-node@v4
with:
node-version: "16"
registry-url: "https://npm.fluence.dev"
cache-dependency-path: avm/client/package-lock.json
cache: "npm"
- run: npm i
working-directory: avm/client
- run: npm run build
working-directory: avm/client
- name: Generate snapshot version
id: version
uses: fluencelabs/github-actions/generate-snapshot-id@main
- name: Publish snapshot
id: snapshot
uses: fluencelabs/github-actions/npm-publish-snapshot@main
with:
working-directory: avm/client
id: ${{ steps.version.outputs.id }}