Skip to content

Commit 54a6243

Browse files
committed
Merge tag '1.5.5' into develop
2 parents 41a033c + 58acc8f commit 54a6243

File tree

4 files changed

+104
-56
lines changed

4 files changed

+104
-56
lines changed

.gitea/workflows/rust.yml

Lines changed: 64 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!#
2-
# Copyright (c) 2025 Hangzhou Guanwaii Technology Co,.Ltd.
2+
# Copyright (c) 2025 Hangzhou Guanwaii Technology Co., Ltd.
33
#
44
# This source code is licensed under the MIT License,
55
# which is located in the LICENSE file in the source tree's root directory.
@@ -8,8 +8,8 @@
88
# Author: mingcheng ([email protected])
99
# File Created: 2025-02-24 10:20:48
1010
#
11-
# Modified By: mingcheng ([email protected])
12-
# Last Modified: 2025-03-03 23:42:24
11+
# Modified By: mingcheng <[email protected]>
12+
# Last Modified: 2025-10-18 08:33:46
1313
##
1414

1515
on: [push, pull_request]
@@ -23,6 +23,18 @@ jobs:
2323
steps:
2424
- uses: actions/checkout@v4
2525
- uses: actions-rust-lang/setup-rust-toolchain@v1
26+
with:
27+
components: rustfmt, clippy
28+
- name: Cache Cargo dependencies
29+
uses: actions/cache@v4
30+
with:
31+
path: |
32+
~/.cargo/registry
33+
~/.cargo/git
34+
target
35+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
36+
restore-keys: |
37+
${{ runner.os }}-cargo-
2638
- run: cargo check
2739

2840
test:
@@ -31,6 +43,18 @@ jobs:
3143
steps:
3244
- uses: actions/checkout@v4
3345
- uses: actions-rust-lang/setup-rust-toolchain@v1
46+
with:
47+
components: rustfmt, clippy
48+
- name: Cache Cargo dependencies
49+
uses: actions/cache@v4
50+
with:
51+
path: |
52+
~/.cargo/registry
53+
~/.cargo/git
54+
target
55+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
56+
restore-keys: |
57+
${{ runner.os }}-cargo-
3458
- run: cargo test --all -- --nocapture
3559

3660
fmt:
@@ -39,7 +63,18 @@ jobs:
3963
steps:
4064
- uses: actions/checkout@v4
4165
- uses: actions-rust-lang/setup-rust-toolchain@v1
42-
- run: rustup component add rustfmt
66+
with:
67+
components: rustfmt, clippy
68+
- name: Cache Cargo dependencies
69+
uses: actions/cache@v4
70+
with:
71+
path: |
72+
~/.cargo/registry
73+
~/.cargo/git
74+
target
75+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
76+
restore-keys: |
77+
${{ runner.os }}-cargo-
4378
- run: cargo fmt --all -- --check
4479

4580
clippy:
@@ -48,7 +83,18 @@ jobs:
4883
steps:
4984
- uses: actions/checkout@v4
5085
- uses: actions-rust-lang/setup-rust-toolchain@v1
51-
- run: rustup component add clippy
86+
with:
87+
components: rustfmt, clippy
88+
- name: Cache Cargo dependencies
89+
uses: actions/cache@v4
90+
with:
91+
path: |
92+
~/.cargo/registry
93+
~/.cargo/git
94+
target
95+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
96+
restore-keys: |
97+
${{ runner.os }}-cargo-
5298
- run: cargo clippy -- -D warnings
5399

54100
build:
@@ -57,5 +103,16 @@ jobs:
57103
steps:
58104
- uses: actions/checkout@v4
59105
- uses: actions-rust-lang/setup-rust-toolchain@v1
60-
- run: |
61-
cargo build
106+
with:
107+
components: rustfmt, clippy
108+
- name: Cache Cargo dependencies
109+
uses: actions/cache@v4
110+
with:
111+
path: |
112+
~/.cargo/registry
113+
~/.cargo/git
114+
target
115+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
116+
restore-keys: |
117+
${{ runner.os }}-cargo-
118+
- run: cargo build

.github/workflows/ghcr.yml

Lines changed: 33 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ on:
44
push:
55
branches:
66
- main
7-
- develop
87
tags:
9-
- "v*.*.*" # Semantic versioning tags (v1.0.0, v1.2.3, etc.)
8+
- "v*.*.*" # Match version tags like v1.2.3
109
pull_request:
1110
branches:
1211
- main
@@ -49,27 +48,26 @@ jobs:
4948
- name: Extract metadata (tags, labels) for Docker
5049
id: meta
5150
uses: docker/metadata-action@v5
51+
env:
52+
DOCKER_METADATA_SHORT_SHA_LENGTH: 7
5253
with:
5354
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
5455
tags: |
55-
# Tag with branch name for branch pushes
56-
type=ref,event=branch
57-
# Tag with PR number for pull requests
58-
type=ref,event=pr
59-
# Tag with git tag for version releases
60-
type=semver,pattern={{version}}
61-
type=semver,pattern={{major}}.{{minor}}
62-
type=semver,pattern={{major}}
63-
# Tag with short SHA
64-
type=sha,format=short
65-
# Tag latest only on main branch
56+
type=semver,pattern={{version}},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
57+
type=semver,pattern={{major}}.{{minor}},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
58+
# # disabled if major zero
59+
# type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }}
60+
type=sha,enable=true,priority=100,prefix=,suffix=,format=short
61+
type=schedule,pattern={{date 'YYYYMMDD'}}
6662
type=raw,value=latest,enable={{is_default_branch}}
6763
labels: |
6864
org.opencontainers.image.title=aigitcommit
6965
org.opencontainers.image.description=AI-powered Git commit message generator
70-
org.opencontainers.image.vendor=Hangzhou Guanwaii Technology Co,.Ltd.
66+
org.opencontainers.image.url=https://github.com/mingcheng/aigitcommit
67+
org.opencontainers.image.vendor=${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
7168
7269
- name: Build and push Docker image
70+
if: steps.meta.outputs.tags != ''
7371
id: push
7472
uses: docker/build-push-action@v6
7573
with:
@@ -85,33 +83,26 @@ jobs:
8583
VCS_REF=${{ github.sha }}
8684
VERSION=${{ steps.meta.outputs.version }}
8785
88-
- name: Generate artifact attestation
89-
if: github.event_name != 'pull_request'
90-
uses: actions/attest-build-provenance@v2
91-
with:
92-
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
93-
subject-digest: ${{ steps.push.outputs.digest }}
94-
push-to-registry: true
95-
96-
- name: Generate SBOM
97-
if: github.event_name != 'pull_request'
98-
uses: anchore/sbom-action@v0
99-
with:
100-
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ steps.push.outputs.digest }}
101-
format: spdx-json
102-
output-file: sbom.spdx.json
86+
# - name: Generate artifact attestation
87+
# if: github.event_name != 'pull_request'
88+
# uses: actions/attest-build-provenance@v3
89+
# with:
90+
# subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
91+
# subject-digest: ${{ steps.push.outputs.digest }}
92+
# push-to-registry: false
10393

104-
- name: Upload SBOM as artifact
105-
if: github.event_name != 'pull_request'
106-
uses: actions/upload-artifact@v4
107-
with:
108-
name: sbom-${{ github.sha }}
109-
path: sbom.spdx.json
110-
retention-days: 90
94+
# - name: Generate SBOM
95+
# if: github.event_name != 'pull_request'
96+
# uses: anchore/[email protected]
97+
# with:
98+
# image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ steps.push.outputs.digest }}
99+
# format: spdx-json
100+
# output-file: sbom.spdx.json
111101

112-
- name: Image digest
113-
if: github.event_name != 'pull_request'
114-
run: |
115-
echo "Image pushed successfully!"
116-
echo "Digest: ${{ steps.push.outputs.digest }}"
117-
echo "Tags: ${{ steps.meta.outputs.tags }}"
102+
# - name: Upload SBOM as artifact
103+
# if: github.event_name != 'pull_request'
104+
# uses: actions/upload-artifact@v4
105+
# with:
106+
# name: ${{ steps.short-sha.outputs.sha }}-sbom
107+
# path: sbom.spdx.json
108+
# retention-days: 90

Cargo.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"
1010

1111
[[package]]
1212
name = "aigitcommit"
13-
version = "1.5.2"
13+
version = "1.5.5"
1414
dependencies = [
1515
"arboard",
1616
"askama",
@@ -1072,9 +1072,9 @@ dependencies = [
10721072

10731073
[[package]]
10741074
name = "indexmap"
1075-
version = "2.11.4"
1075+
version = "2.12.0"
10761076
source = "registry+https://github.com/rust-lang/crates.io-index"
1077-
checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5"
1077+
checksum = "6717a8d2a5a929a1a2eb43a12812498ed141a0bcfb7e8f7844fbdbe4303bba9f"
10781078
dependencies = [
10791079
"equivalent",
10801080
"hashbrown",
@@ -1268,13 +1268,13 @@ dependencies = [
12681268

12691269
[[package]]
12701270
name = "mio"
1271-
version = "1.0.4"
1271+
version = "1.1.0"
12721272
source = "registry+https://github.com/rust-lang/crates.io-index"
1273-
checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c"
1273+
checksum = "69d83b0086dc8ecf3ce9ae2874b2d1290252e2a30720bea58a5c6639b0092873"
12741274
dependencies = [
12751275
"libc",
12761276
"wasi",
1277-
"windows-sys 0.59.0",
1277+
"windows-sys 0.61.2",
12781278
]
12791279

12801280
[[package]]

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "aigitcommit"
3-
version = "1.5.2"
3+
version = "1.5.5"
44
edition = "2024"
55
description = "A simple git commit message generator by OpenAI compaction model."
66
license-file = "LICENSE"

0 commit comments

Comments
 (0)