mirror of
https://github.com/fluencelabs/sqlite-wasm-connector
synced 2025-03-14 22:10:49 +00:00
94 lines
2.4 KiB
YAML
94 lines
2.4 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
|
|
default: "null"
|
|
outputs:
|
|
version:
|
|
description: "snapshot version"
|
|
value: ${{ jobs.snapshot.outputs.version }}
|
|
|
|
jobs:
|
|
snapshot:
|
|
name: "Publish snapshot"
|
|
runs-on: builder
|
|
timeout-minutes: 60
|
|
|
|
outputs:
|
|
version: "${{ steps.snapshot.outputs.version }}"
|
|
|
|
permissions:
|
|
contents: read
|
|
id-token: write
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
with:
|
|
repository: fluencelabs/sqlite-wasm-connector
|
|
ref: ${{ inputs.ref }}
|
|
|
|
- name: Import secrets
|
|
uses: hashicorp/vault-action@v2.5.0
|
|
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: dsherret/rust-toolchain-file@v1
|
|
|
|
- name: Setup cache
|
|
uses: Swatinem/rust-cache@v2
|
|
with:
|
|
shared-key: sqlite-wasm-connector
|
|
# github allows only 10GB of cache
|
|
# so save cache only on merge to master
|
|
# to use less space and speed up CI
|
|
save-if: ${{ github.event_name == 'push' }}
|
|
|
|
- name: Set dependencies
|
|
if: inputs.cargo-dependencies != 'null'
|
|
uses: fluencelabs/github-actions/cargo-set-dependency@main
|
|
with:
|
|
dependencies: ${{ inputs.cargo-dependencies }}
|
|
|
|
- name: Setup marine
|
|
uses: fluencelabs/setup-marine@v1
|
|
with:
|
|
artifact-name: marine
|
|
|
|
- name: Download sqlite-wasm
|
|
uses: actions/download-artifact@v3
|
|
continue-on-error: true
|
|
with:
|
|
name: sqlite-wasm
|
|
path: artifacts/
|
|
|
|
- name: Build
|
|
run: ./build.sh
|
|
|
|
- name: Generate snapshot version
|
|
id: version
|
|
uses: fluencelabs/github-actions/generate-snapshot-id@main
|
|
|
|
- name: Publish snapshot
|
|
uses: fluencelabs/github-actions/cargo-publish-snapshot@main
|
|
id: snapshot
|
|
with:
|
|
id: ${{ steps.version.outputs.id }}
|