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
permissions:
contents: read
on:
push:
branches:
- main
# pull_request:
workflow_dispatch:
# If new code is pushed to a PR branch, then cancel in progress workflows for that PR.
# Ensures that we don't waste CI time, and returns results quicker
# https://github.com/jonhoo/rust-ci-conf/pull/5
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
name: Deploy rapid fs
jobs:
required:
#Don't change noble without changing the Dockerfile
runs-on: ubuntu-22.04
name: ubuntu / ${{ matrix.toolchain }}
strategy:
matrix:
# run on stable and beta to ensure that tests won't break on the next version of the rust
# toolchain
#, beta
toolchain:
steps:
- uses: actions/checkout@v4
with:
submodules: true
token: ${{ secrets.CROSS_REPO_TOKEN }}
#Configure git to auth with the cross repo PAT
- run: git config --global url."https://${{ secrets.CROSS_REPO_TOKEN }}@github.com".insteadOf ssh://git@github.com
# - run: git config --global url."https://${{ secrets.CROSS_REPO_TOKEN }}@github.com".insteadOf https://github.com
- uses: Swatinem/rust-cache@v2
- name: Install ${{ matrix.toolchain }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- name: cargo generate-lockfile
# enable this ci template to run regardless of whether the lockfile is checked in or not
if: hashFiles('Cargo.lock') == ''
run: cargo generate-lockfile
# # https://twitter.com/jonhoo/status/1571290371124260865
# - name: cargo test --locked
# run: cargo test --locked --all-features --all-targets
#
# # https://github.com/rust-lang/cargo/issues/6669
# - name: cargo test --doc
# run: cargo test --locked --all-features --doc
#https://doc.rust-lang.org/cargo/reference/publishing.html#publishing-on-cratesio
#PWD=../.. to set the dir back to the root. build.rs assumes root dir
#--allow-dirty because we copy the proto dir from root
# --dry-run to test changes before publishing to cargo
- name: deploy
run: |
CARGO_REGISTRY_TOKEN=${{ secrets.RUST_CRATES_TOKEN }} cargo publish --allow-dirty