File tree 1 file changed +9
-7
lines changed
1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ name: Rust Build and Release
3
3
on :
4
4
push :
5
5
branches :
6
- - main
6
+ - main # Change this to your main branch name if different
7
7
8
8
jobs :
9
9
build :
@@ -20,15 +20,17 @@ jobs:
20
20
profile : minimal
21
21
toolchain : stable
22
22
23
- - name : Read Cargo.toml
24
- id : read_cargo_toml
25
- run : echo ::set-output name=version::$(grep -oP '(?<=version = ")[^"]*' Cargo.toml)
23
+ - name : Extract Version from Cargo.toml
24
+ id : extract_version
25
+ run : |
26
+ VERSION=$(grep -Po '(?<=^version = ")[^"]*' Cargo.toml | head -n1)
27
+ echo "::set-output name=version::${VERSION}"
26
28
27
29
- name : Build
28
30
run : |
29
31
cargo build --release
30
32
env :
31
- APP_VERSION : ${{ steps.read_cargo_toml .outputs.version }}
33
+ APP_VERSION : ${{ steps.extract_version .outputs.version }}
32
34
33
35
- name : Package Binary
34
36
run : |
42
44
env :
43
45
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
44
46
with :
45
- tag_name : v${{ steps.read_cargo_toml .outputs.version }}
46
- release_name : Release v${{ steps.read_cargo_toml .outputs.version }}
47
+ tag_name : v${{ steps.extract_version .outputs.version }}
48
+ release_name : Release v${{ steps.extract_version .outputs.version }}
47
49
body : |
48
50
Release description goes here
49
51
draft : false
You can’t perform that action at this time.
0 commit comments