Skip to content

Commit d451967

Browse files
authored
[CI][Rust] Add publish step (#14)
1 parent 40662e1 commit d451967

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

.github/workflows/test.yml renamed to .github/workflows/build_test.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Test"
1+
name: "Build & Test"
22

33
on:
44
push:
@@ -50,6 +50,18 @@ jobs:
5050
- name: "[Rust] [optify] Test"
5151
run: cargo test --release
5252
working-directory: ./rust/optify
53+
- name: "[Rust] Publish"
54+
if: github.ref == 'refs/heads/main'
55+
shell: bash
56+
# It probably just fails if the crate is already published.
57+
# We want to only be lenient for the `cargo publish`, but we would still want to clearly see that an issue happened during the run.
58+
continue-on-error: true
59+
run: |
60+
cargo login
61+
cargo publish
62+
env:
63+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
64+
working-directory: ./rust/optify
5365

5466
# Ruby
5567
# setup-ruby also runs `bundle install`.

.github/workflows/cross-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ jobs:
9595
if: github.ref == 'refs/heads/main'
9696
shell: bash
9797
# It probably just fails if the gem is already published.
98-
# We don't want to only be lenient for the `gem push`, but we would still want to clearly see that an issue happened during the run.
98+
# We want to only be lenient for the `gem push`, but we would still want to clearly see that an issue happened during the run.
9999
continue-on-error: true
100100
run: |
101101
set -ex

0 commit comments

Comments
 (0)