forked from stainless-steel/sqlite
-
Notifications
You must be signed in to change notification settings - Fork 1
83 lines (70 loc) · 2.1 KB
/
snapshot.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 snapshots
on:
workflow_call:
inputs:
ref:
description: "GitHub ref to checkout to"
type: string
default: "master"
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@v4
with:
repository: fluencelabs/sqlite-wasm-connector
ref: ${{ inputs.ref }}
- 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/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: Setup marine
uses: fluencelabs/setup-marine@v1
with:
artifact-name: marine
- name: Download sqlite-wasm
uses: actions/download-artifact@v4
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 }}