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
# This workflow will publish the rust package to crates.io on release
# or manual trigger
#
# REQUIREMENTS:
# - Define a secret `CRATES_IO_TOKEN` in your github environment
#
# MAINTENANCE:
# - Workflow triggers `on: ...` can be edited and Sideko will maintain the `jobs: ...`
# - Alternatively, if you wish to fully customize the workflow, you can clone this
# file (save under a different filepath to avoid clashing) and either disable this workflow
# via the triggers or remove `github` from the `ci_cd` options in the SDK config.
#
name: Publish to crates.io
on:
workflow_dispatch:
push:
branches:
- main
env:
SIDEKO_BASE_URL: https://api.sideko-staging.dev/v1
jobs:
publish:
runs-on: ubuntu-latest
steps:
#---------------------------------------------------
# ----- checkout & setup rust toolchain -----
#---------------------------------------------------
- name: checkout repository
uses: actions/checkout@v4
- name: setup rust
uses: actions-rust-lang/setup-rust-toolchain@v1
#---------------------------------------
# ----- publish to crates.io -----
#---------------------------------------
- name: publish
run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }}
#----------------------------------------------
# ----- mark SDK as released in Sideko -----
#----------------------------------------------
- name: install sideko cli
run: npm install -g @sideko/cli
- name: mark sdk as released
env:
SIDEKO_API_KEY: ${{ secrets.SIDEKO_API_KEY }}
run: sideko sdk released