-
Notifications
You must be signed in to change notification settings - Fork 14
45 lines (39 loc) · 1.16 KB
/
publish_release.yaml
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
name: Publish on Crates.io
on:
release:
types:
- published
env:
CI: true
RUST_VERSION: 1.79.0
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
publish-crates:
name: Publish on Crates.io
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set NATS environment variables
shell: bash
run: |
set_env_var() {
echo "$1=${!1:-$2}" >> $GITHUB_ENV
echo "$1=${!1:-$2}" >> .env
}
set_env_var "NATS_URL" "nats://127.0.0.1:4222"
set_env_var "NATS_ADMIN_PASS" "default_pass"
set_env_var "NATS_PUBLIC_PASS" "temp-public-pass"
- name: Install toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_VERSION }}
target: x86_64-unknown-linux-gnu,wasm32-unknown-unknown
- name: Publish Crate
uses: katyo/publish-crates@v2
id: publish-crates
with:
publish-delay: 60000
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
ignore-unpublished-changes: true