Skip to content

Commit e8ed341

Browse files
chore(deps): update dtolnay/rust-toolchain digest to f7ccc83 (#151)
- update deps - update github action [shared-zerv-versioning.yml](https://github.com/wislertt/zerv/pull/151/files#diff-29d7c7e0b21b77b558f9649c2751fdaa7dc836db5ccc8a360771f907cc98ff10) - update Install cargo-audit in github action - update readme for Multiple Format Generation and its corresponding test --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Wisaroot Lertthaweedech <[email protected]>
1 parent c065ab3 commit e8ed341

File tree

9 files changed

+234
-46
lines changed

9 files changed

+234
-46
lines changed

.github/workflows/cd.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ jobs:
9595
steps:
9696
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
9797

98-
- uses: dtolnay/rust-toolchain@0b1efabc08b657293548b77fb76cc02d26091c7e # stable
98+
- uses: dtolnay/rust-toolchain@f7ccc83f9ed1e5b9c81d8a67d7ad1a747e22a561 # stable
9999
with:
100100
toolchain: stable
101101
targets: ${{ matrix.target }}
@@ -137,7 +137,7 @@ jobs:
137137
steps:
138138
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
139139

140-
- uses: dtolnay/rust-toolchain@0b1efabc08b657293548b77fb76cc02d26091c7e # stable
140+
- uses: dtolnay/rust-toolchain@f7ccc83f9ed1e5b9c81d8a67d7ad1a747e22a561 # stable
141141
with:
142142
toolchain: stable
143143

.github/workflows/pre-commit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Install Prettier
2222
run: npm install -g prettier
2323

24-
- uses: dtolnay/rust-toolchain@0b1efabc08b657293548b77fb76cc02d26091c7e # stable
24+
- uses: dtolnay/rust-toolchain@f7ccc83f9ed1e5b9c81d8a67d7ad1a747e22a561 # stable
2525
with:
2626
toolchain: nightly
2727
components: rustfmt, clippy

.github/workflows/security.yml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
4444

4545
- name: Setup Rust
46-
uses: dtolnay/rust-toolchain@0b1efabc08b657293548b77fb76cc02d26091c7e # stable
46+
uses: dtolnay/rust-toolchain@f7ccc83f9ed1e5b9c81d8a67d7ad1a747e22a561 # stable
4747
with:
4848
toolchain: stable
4949

@@ -61,10 +61,31 @@ jobs:
6161
cargo-audit-${{ runner.os }}-
6262
6363
- name: Install cargo-audit
64-
run: cargo install cargo-audit --locked || true
64+
run: |
65+
# Get currently installed version (if any)
66+
if command -v cargo-audit >/dev/null 2>&1; then
67+
CURRENT_VERSION=$(cargo audit --version | awk '{print $2}')
68+
else
69+
CURRENT_VERSION=""
70+
fi
71+
72+
# Get latest version from crates.io
73+
LATEST_VERSION=$(cargo search cargo-audit --limit 1 | head -n 1 | sed -E 's/.*"([^"]+)".*/\1/')
74+
75+
echo "Current cargo-audit version: ${CURRENT_VERSION:-none}"
76+
echo "Latest cargo-audit version : $LATEST_VERSION"
77+
78+
# Install if not installed or if outdated
79+
if [ "$CURRENT_VERSION" != "$LATEST_VERSION" ]; then
80+
echo "Installing latest cargo-audit ($LATEST_VERSION)"
81+
cargo install cargo-audit --force
82+
else
83+
echo "cargo-audit is up to date"
84+
fi
6585
6686
- name: Run cargo audit
67-
run: cargo audit
87+
run: |
88+
cargo audit
6889
6990
- name: Save cache
7091
uses: actions/cache/save@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1

.github/workflows/shared-zerv-versioning.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,24 @@ on:
5454
type: string
5555
required: false
5656
description: "JSON object mapping output names to zerv output templates (without quotes)"
57+
# Note: v_major_custom/v_major_minor_custom demonstrate custom template-based approach
58+
# vs schema-based approach in custom_outputs (v_major/v_major_minor)
5759
default: >-
5860
{
5961
"docker_tag": "{{ semver_obj.docker }}",
60-
"v_major": "v{{ major | default(value=\\\"0\\\") }}",
61-
"v_major_minor": "v{{ major | default(value=\\\"0\\\") }}{{ prefix_if(value=minor, prefix=\\\".\\\") }}"
62+
"v_major_custom": "v{{ major | default(value=\\\"0\\\") }}",
63+
"v_major_minor_custom": "v{{ major | default(value=\\\"0\\\") }}{{ prefix_if(value=minor, prefix=\\\".\\\") }}"
6264
}
6365
custom_outputs:
6466
type: string
6567
required: false
6668
description: "JSON object mapping output names to full zerv command arguments"
67-
default: '{"v_semver": "--output-prefix v --output-format semver"}'
69+
default: >-
70+
{
71+
"v_semver": "--output-prefix v --output-format semver",
72+
"v_major": "--schema-ron \"(core:[var(Major)], extra_core:[], build:[])\" --output-prefix v --output-format pep440",
73+
"v_major_minor": "--schema-ron \"(core:[var(Major), var(Minor)], extra_core:[], build:[])\" --output-prefix v --output-format pep440"
74+
}
6875
6976
outputs:
7077
versions:
@@ -82,7 +89,7 @@ jobs:
8289
with:
8390
fetch-depth: 0
8491

85-
- uses: dtolnay/rust-toolchain@0b1efabc08b657293548b77fb76cc02d26091c7e # stable
92+
- uses: dtolnay/rust-toolchain@f7ccc83f9ed1e5b9c81d8a67d7ad1a747e22a561 # stable
8693
with:
8794
toolchain: stable
8895

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
with:
2525
fetch-depth: 0
2626

27-
- uses: dtolnay/rust-toolchain@0b1efabc08b657293548b77fb76cc02d26091c7e # stable
27+
- uses: dtolnay/rust-toolchain@f7ccc83f9ed1e5b9c81d8a67d7ad1a747e22a561 # stable
2828
with:
2929
toolchain: stable
3030

Cargo.lock

Lines changed: 43 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ homepage = "https://github.com/wislertt/zerv"
1313
readme = "README.md"
1414
keywords = ["cli", "versioning", "git", "semver"]
1515
categories = ["command-line-utilities", "development-tools::build-utils", "config", "parsing"]
16-
rust-version = "1.91"
16+
rust-version = "1.92"
1717
exclude = [
1818
"/.github/",
1919
"/scripts/",

0 commit comments

Comments
 (0)