mirror of
https://github.com/fluencelabs/aquavm
synced 2025-03-15 12:30:50 +00:00
247 lines
6.6 KiB
YAML
247 lines
6.6 KiB
YAML
name: Publish snapshots
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
ref:
|
|
description: "GitHub ref to checkout to"
|
|
type: string
|
|
default: "master"
|
|
cargo-dependencies:
|
|
description: "Cargo dependencies map"
|
|
type: string
|
|
outputs:
|
|
cargo-version:
|
|
description: "Cargo snapshot version"
|
|
value: ${{ jobs.cargo-snapshot.outputs.version }}
|
|
avm-version:
|
|
description: "@fluencelabs/avm version"
|
|
value: ${{ jobs.publish-avm.outputs.version }}
|
|
air-beautify-wasm-version:
|
|
description: "air-beautify-wasm version"
|
|
value: ${{ jobs.publish-beautify.outputs.version }}
|
|
|
|
env:
|
|
FORCE_COLOR: true
|
|
|
|
jobs:
|
|
wasm:
|
|
name: "Build air-interpreter-wasm"
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout AquaVM
|
|
uses: actions/checkout@v3
|
|
with:
|
|
repository: fluencelabs/aquavm
|
|
ref: ${{ inputs.ref }}
|
|
|
|
- name: Setup Rust toolchain
|
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
|
|
- name: Install marine
|
|
uses: baptiste0928/cargo-install@v1.3.0
|
|
with:
|
|
crate: marine
|
|
|
|
- name: Build air-interpreter-wasm binary
|
|
run: marine build --release --features marine
|
|
working-directory: air-interpreter
|
|
|
|
- name: Upload air-interpreter-wasm binary
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: air-interpreter-wasm
|
|
path: target/wasm32-wasi/release/air_interpreter_server.wasm
|
|
|
|
cargo-snapshot:
|
|
name: "Publish cargo snapshots"
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: wasm
|
|
|
|
outputs:
|
|
version: "${{ steps.snapshot.outputs.version }}"
|
|
|
|
permissions:
|
|
contents: read
|
|
id-token: write
|
|
|
|
steps:
|
|
- name: Checkout AquaVM
|
|
uses: actions/checkout@v3
|
|
with:
|
|
repository: fluencelabs/aquavm
|
|
ref: ${{ inputs.ref }}
|
|
|
|
- name: Import secrets
|
|
uses: hashicorp/vault-action@v2.4.3
|
|
with:
|
|
url: https://vault.fluence.dev
|
|
path: jwt/github
|
|
role: ci
|
|
method: jwt
|
|
jwtGithubAudience: "https://github.com/fluencelabs"
|
|
jwtTtl: 300
|
|
exportToken: false
|
|
secrets: |
|
|
kv/cargo-registry/users/ci token | CARGO_REGISTRIES_FLUENCE_TOKEN
|
|
|
|
- name: Setup Rust toolchain
|
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
|
|
- name: Set dependencies
|
|
if: inputs.cargo-dependencies != ''
|
|
uses: fluencelabs/github-actions/cargo-set-dependency@main
|
|
with:
|
|
dependencies: ${{ inputs.cargo-dependencies }}
|
|
|
|
- name: Download air-interpreter-wasm binary
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: air-interpreter-wasm
|
|
|
|
- name: Move air_interpreter_server.wasm
|
|
run: mv air_interpreter_server.wasm crates/interpreter-wasm/
|
|
|
|
- name: Add air-interpreter-wasm to workspace
|
|
run: |
|
|
sed -i '/members/a "crates/interpreter-wasm",' Cargo.toml
|
|
|
|
- name: Generate snapshot version
|
|
id: version
|
|
uses: fluencelabs/github-actions/generate-snapshot-id@main
|
|
|
|
- name: Publish crate snapshots
|
|
id: snapshot
|
|
uses: fluencelabs/github-actions/cargo-publish-snapshot@main
|
|
with:
|
|
id: ${{ steps.version.outputs.id }}
|
|
|
|
publish-avm:
|
|
name: "Publish @fluencelabs/avm snapshot"
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: wasm
|
|
|
|
outputs:
|
|
version: "${{ steps.snapshot.outputs.version }}"
|
|
|
|
permissions:
|
|
contents: read
|
|
id-token: write
|
|
|
|
steps:
|
|
- name: Checkout AquaVM
|
|
uses: actions/checkout@v3
|
|
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/vault-action@v2.4.3
|
|
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@v3
|
|
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 }}
|
|
|
|
publish-air-beautify:
|
|
name: "Publish air-beautify-wasm snapshot"
|
|
runs-on: builder
|
|
|
|
outputs:
|
|
version: "${{ steps.snapshot.outputs.version }}"
|
|
|
|
permissions:
|
|
contents: read
|
|
id-token: write
|
|
|
|
steps:
|
|
- name: Checkout aquavm
|
|
uses: actions/checkout@v3
|
|
with:
|
|
repository: fluencelabs/aquavm
|
|
ref: ${{ inputs.ref }}
|
|
|
|
- name: Import secrets
|
|
uses: hashicorp/vault-action@v2.4.3
|
|
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 Rust toolchain
|
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
|
|
- name: Setup wasm-pack
|
|
uses: jetli/wasm-pack-action@v0.4.0
|
|
|
|
- name: Setup node with self-hosted npm registry
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: "16"
|
|
registry-url: "https://npm.fluence.dev"
|
|
|
|
- name: Build air-beautify-wasm
|
|
run: |
|
|
rm -rf pack
|
|
wasm-pack build --release
|
|
working-directory: tools/wasm/air-beautify-wasm
|
|
|
|
- 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: tools/wasm/air-beautify-wasm/pkg
|
|
id: ${{ steps.version.outputs.id }}
|