Skip to content

Commit 1acc921

Browse files
committed
ci(release): add release ci/cd
1 parent 0fd94d3 commit 1acc921

2 files changed

Lines changed: 71 additions & 45 deletions

File tree

Lines changed: 47 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Rust CI/CD
1+
name: Release CI/CD
22

33
on:
44
push:
@@ -17,7 +17,7 @@ jobs:
1717
name: Lint
1818
runs-on: ubuntu-latest
1919
steps:
20-
- uses: actions/checkout@v3
20+
- uses: actions/checkout@v4
2121
- name: Setup Rust
2222
uses: dtolnay/rust-toolchain@stable
2323
with:
@@ -28,30 +28,30 @@ jobs:
2828
run: cargo clippy -- -D warnings
2929

3030
# Tested on multiple platforms
31-
# test:
32-
# name: Test
33-
# needs: lint
34-
# runs-on: ${{ matrix.os }}
35-
# strategy:
36-
# matrix:
37-
# os: [ubuntu-latest, windows-latest, macos-latest]
38-
# rust: [stable]
39-
# steps:
40-
# - uses: actions/checkout@v3
41-
# - name: Setup Rust
42-
# uses: dtolnay/rust-toolchain@stable
43-
# with:
44-
# toolchain: ${{ matrix.rust }}
45-
# - name: Cargo Cache
46-
# uses: actions/cache@v3
47-
# with:
48-
# path: |
49-
# ~/.cargo/registry
50-
# ~/.cargo/git
51-
# target
52-
# key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
53-
# - name: Run Tests
54-
# run: cargo test --all-features
31+
test:
32+
name: Test
33+
needs: lint
34+
runs-on: ${{ matrix.os }}
35+
strategy:
36+
matrix:
37+
os: [ubuntu-latest, windows-latest, macos-latest]
38+
rust: [stable]
39+
steps:
40+
- uses: actions/checkout@v4
41+
- name: Setup Rust
42+
uses: dtolnay/rust-toolchain@stable
43+
with:
44+
toolchain: ${{ matrix.rust }}
45+
- name: Cargo Cache
46+
uses: actions/cache@v4
47+
with:
48+
path: |
49+
~/.cargo/registry
50+
~/.cargo/git
51+
target
52+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
53+
- name: Run Tests
54+
run: cargo test --all-features
5555

5656
# Build binary files for different platforms.
5757
build:
@@ -72,52 +72,54 @@ jobs:
7272
target: x86_64-apple-darwin
7373
suffix: ''
7474
steps:
75-
- uses: actions/checkout@v3
75+
- uses: actions/checkout@v4
7676
- name: Setup Rust
7777
uses: dtolnay/rust-toolchain@stable
7878
- name: Build Release Binary
7979
run: cargo build --verbose --release
8080
- name: Upload Build Artifact
81-
uses: actions/upload-artifact@v3
81+
uses: actions/upload-artifact@v4
8282
with:
8383
name: ${{ github.event.repository.name }}-${{ matrix.target }}
8484
path: target/release/${{ github.event.repository.name }}${{ matrix.suffix }}
8585

8686
# Post to crates.io (only when tagged)
87-
# publish:
88-
# name: Publish to crates.io
89-
# needs: build
90-
# runs-on: ubuntu-latest
91-
# if: startsWith(github.ref, 'refs/tags/v')
92-
# steps:
93-
# - uses: actions/checkout@v3
94-
# - name: Setup Rust
95-
# uses: dtolnay/rust-toolchain@stable
96-
# - name: Cargo Login
97-
# run: cargo login ${{ secrets.CRATES_IO_TOKEN }}
98-
# - name: Cargo Publish
99-
# run: cargo publish
87+
publish:
88+
name: Publish to crates.io
89+
needs: build
90+
runs-on: ubuntu-latest
91+
if: startsWith(github.ref, 'refs/tags/v')
92+
steps:
93+
- uses: actions/checkout@v4
94+
- name: Setup Rust
95+
uses: dtolnay/rust-toolchain@stable
96+
- name: Cargo Login
97+
run: cargo login ${{ secrets.CRATES_IO_TOKEN }}
98+
- name: Cargo Publish
99+
run: cargo publish
100100

101101
# Publish GitHub Release (only when tagging)
102102
github_release:
103103
name: Create GitHub Release
104104
needs: build
105105
runs-on: ubuntu-latest
106106
if: startsWith(github.ref, 'refs/tags/v')
107+
permissions:
108+
contents: write
107109
steps:
108-
- uses: actions/checkout@v3
110+
- uses: actions/checkout@v4
109111
- name: Download Linux Build
110-
uses: actions/download-artifact@v3
112+
uses: actions/download-artifact@v4
111113
with:
112114
name: ${{ github.event.repository.name }}-x86_64-unknown-linux-gnu
113115
path: ./linux
114116
- name: Download Windows Build
115-
uses: actions/download-artifact@v3
117+
uses: actions/download-artifact@v4
116118
with:
117119
name: ${{ github.event.repository.name }}-x86_64-pc-windows-msvc
118120
path: ./windows
119121
- name: Download macOS Build
120-
uses: actions/download-artifact@v3
122+
uses: actions/download-artifact@v4
121123
with:
122124
name: ${{ github.event.repository.name }}-x86_64-apple-darwin
123125
path: ./macos

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# VMonitor
2+
3+
VMonitor is a simple and lightweight system monitor that sends system information to a WebSocket server.
4+
5+
## License
6+
```
7+
Copyright (C) 2025 by AprilNEA <github@sku.moe>
8+
9+
This program is free software: you can redistribute it and/or modify
10+
it under the terms of the GNU General Public License as published by
11+
the Free Software Foundation, either version 3 of the License, or
12+
(at your option) any later version.
13+
14+
This program is distributed in the hope that it will be useful,
15+
but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
GNU General Public License for more details.
18+
19+
You should have received a copy of the GNU General Public License
20+
along with this program. If not, see <http://www.gnu.org/licenses/>.
21+
22+
In addition, no derivative work may use the name or imply association
23+
with this application without prior consent.
24+
```

0 commit comments

Comments
 (0)