Skip to content

Commit 4bf92da

Browse files
committed
feat: add release ci workflow
Signed-off-by: jinlong <[email protected]>
1 parent e9a3f74 commit 4bf92da

File tree

5 files changed

+67
-4
lines changed

5 files changed

+67
-4
lines changed

.github/workflows/release.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
9+
10+
jobs:
11+
build:
12+
name: Build and Release
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
include:
17+
- os: ubuntu-latest
18+
container: rust:1.84-bullseye
19+
target: x86_64-unknown-linux-gnu
20+
binary_name: fastcommit
21+
asset_name: fastcommit-linux-x86_64
22+
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
27+
- name: Build binary
28+
run: cargo build --release --target ${{ matrix.target }}
29+
30+
- name: Prepare binary (Unix)
31+
if: matrix.os != 'windows-latest'
32+
run: |
33+
cp target/${{ matrix.target }}/release/${{ matrix.binary_name }} ${{ matrix.asset_name }}
34+
strip ${{ matrix.asset_name }} || true
35+
36+
- name: Upload artifact
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: ${{ matrix.asset_name }}
40+
path: ${{ matrix.asset_name }}
41+
42+
release:
43+
name: Create Release
44+
needs: build
45+
runs-on: ubuntu-latest
46+
steps:
47+
- name: Checkout code
48+
uses: actions/checkout@v4
49+
50+
- name: Download all artifacts
51+
uses: actions/download-artifact@v4
52+
with:
53+
path: artifacts
54+
55+
- name: Create release
56+
uses: softprops/action-gh-release@v1
57+
with:
58+
files: artifacts/**/*
59+
generate_release_notes: true
60+
draft: false
61+
prerelease: false
62+
env:
63+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Cargo.lock

Lines changed: 1 addition & 1 deletion
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
@@ -1,6 +1,6 @@
11
[package]
22
name = "fastcommit"
3-
version = "0.1.3"
3+
version = "0.1.4"
44
description = "AI-based command line tool to quickly generate standardized commit messages."
55
edition = "2021"
66
authors = ["longjin <[email protected]>"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ You can install `fastcommit` using the following method:
1010

1111
```bash
1212
# Install using cargo
13-
cargo install --git https://github.com/fslongjin/fastcommit --tag 0.1.3
13+
cargo install --git https://github.com/fslongjin/fastcommit --tag v0.1.4
1414
```
1515

1616
## Usage

README_CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
```bash
1010
# 使用 cargo 安装
11-
cargo install --git https://github.com/fslongjin/fastcommit --tag 0.1.3
11+
cargo install --git https://github.com/fslongjin/fastcommit --tag v0.1.4
1212
```
1313

1414
## 使用

0 commit comments

Comments
 (0)