Commit 47a8977 1 parent cc4bf98 commit 47a8977 Copy full SHA for 47a8977
File tree 2 files changed +42
-5
lines changed
2 files changed +42
-5
lines changed Original file line number Diff line number Diff line change
1
+ name : Release Rust Crates
2
+
3
+ on :
4
+ push :
5
+ branches : [ master, develop ]
6
+ paths :
7
+ - ' source/ports/rs_port/Cargo.toml'
8
+ - ' source/ports/rs_port/inline/Cargo.toml'
9
+
10
+ concurrency :
11
+ group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
12
+ cancel-in-progress : true
13
+
14
+ env :
15
+ CARGO_REGISTRY_TOKEN : ${{ secrets.CARGO_REGISTRY_TOKEN }}
16
+
17
+ jobs :
18
+ release :
19
+ name : Release Rust Port
20
+ runs-on : ubuntu-latest
21
+ steps :
22
+ - name : Check out the repo
23
+ uses : actions/checkout@v4
24
+ with :
25
+ fetch-depth : 0
26
+ - name : Release the port
27
+ run : |
28
+ cd source/ports/rs_port
29
+ bash ./upload.sh
Original file line number Diff line number Diff line change 1
- #! /usr/bin/env sh
1
+ #! /usr/bin/env bash
2
2
3
3
#
4
4
# MetaCall Rust Port Deploy Script by Parra Studios
19
19
# limitations under the License.
20
20
#
21
21
22
- # TODO: Automate for CD/CI
22
+ function publish() {
23
+ local crate_version=` cargo search --quiet $1 | grep " $1 " | head -n 1 | awk ' { print $3 }' `
24
+ local project_version=` cargo metadata --format-version=1 --no-deps | jq ' .packages[0].version' `
25
+
26
+ # Check if versions do not match, and if so, publish them
27
+ if [ ! " ${crate_version} " = " ${project_version} " ]; then
28
+ echo " Publishing ${crate_version} -> ${project_version} "
29
+ cargo publish --verbose --locked --token ${CARGO_REGISTRY_TOKEN}
30
+ fi
31
+ }
23
32
24
33
# Publish
25
- cargo login $TOKEN
26
34
cd inline
27
- cargo publish
35
+ publish metacall-inline
28
36
cd ..
29
- cargo publish
37
+ publish metacall
You can’t perform that action at this time.
0 commit comments