Skip to content

Commit 4ae584a

Browse files
committed
ci - adds cargo-self-version
simplifying the process to retrieve version from Cargo.toml also removed the release notes reference for now (we will figure out a better way to generate it later)
1 parent ba804e3 commit 4ae584a

File tree

1 file changed

+18
-20
lines changed

1 file changed

+18
-20
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@ name: Rust
22

33
on:
44
push:
5-
branches: ["release/*"]
5+
branches: ["feature/*", "release/*"]
66
# pull_request:
77
# branches: [ "main" ]
88

99
env:
1010
CARGO_TERM_COLOR: always
1111

12-
# TODO add musl to CI see DEVELOPMENT.md
13-
1412
jobs:
1513
test:
1614
name: Running Tests
@@ -20,19 +18,19 @@ jobs:
2018
uses: actions/checkout@v4
2119
- name: Run tests
2220
run: cargo test
23-
publish_cratesio:
24-
needs: test
25-
name: Publish to crates.io
26-
runs-on: ubuntu-latest
27-
steps:
28-
- name: Checkout Repo
29-
uses: actions/checkout@v4
30-
- name: Install Extra Cargo Crates
31-
run: cargo install cargo-caw-publish
32-
- name: Publish to crates.io
33-
env:
34-
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
35-
run: cargo caw-publish
21+
# publish_cratesio:
22+
# needs: test
23+
# name: Publish to crates.io
24+
# runs-on: ubuntu-latest
25+
# steps:
26+
# - name: Checkout Repo
27+
# uses: actions/checkout@v4
28+
# - name: Install Extra Cargo Crates
29+
# run: cargo install cargo-caw-publish
30+
# - name: Publish to crates.io
31+
# env:
32+
# CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
33+
# run: cargo caw-publish
3634
cargo_build:
3735
needs: test
3836
name: Cargo - Building Artifacts
@@ -89,12 +87,13 @@ jobs:
8987
- name: Checkout Repo
9088
uses: actions/checkout@v4
9189

92-
# TODO create a cargo crate to query data from Cargo.toml
90+
- name: Installing Extra Cargo Crates
91+
run: cargo install cargo-self-version
9392

9493
- id: capture_version_from_cargo
9594
name: Capture Version from Cargo.toml
9695
run: |
97-
ver=$(cat Cargo.toml | grep -e '^version = ".*"$' | sed 's/version = "\(.*\)"/\1/')
96+
ver=$(cargo self-version)
9897
echo "pkg_ver=$ver" >> "$GITHUB_OUTPUT"
9998
10099
- name: Create Github Release
@@ -103,7 +102,7 @@ jobs:
103102
PKG_VER: ${{ steps.capture_version_from_cargo.outputs.pkg_ver }}
104103
run: |
105104
gh release create \
106-
--title v$PKG_VER --notes-file RELEASE.md $PKG_VER
105+
--title v$PKG_VER $PKG_VER
107106
github_release_upload:
108107
needs: github_release_create
109108
name: Github Release - Upload Artifacts
@@ -134,7 +133,6 @@ jobs:
134133
- name: Publish to Github Releases
135134
env:
136135
GH_TOKEN: ${{ secrets.GH_TOKEN }}
137-
# TODO resolving to blank
138136
PKG_VER: ${{ needs.github_release_create.outputs.pkg_ver }}
139137
run: |
140138
gh release upload $PKG_VER \

0 commit comments

Comments
 (0)