Skip to content

Commit 2b1ec77

Browse files
authored
Initial commit
0 parents  commit 2b1ec77

11 files changed

Lines changed: 340 additions & 0 deletions

File tree

.env

Whitespace-only changes.

.github/workflows/cli.yml

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
# Before usage
2+
# - Change name of output files
3+
# - Change lint command if needed
4+
5+
name: Release CLI
6+
7+
on:
8+
push:
9+
tags:
10+
- "v*.*.*"
11+
12+
env:
13+
CARGO_TERM_COLOR: always
14+
BINARY_NAME: change_me
15+
16+
jobs:
17+
lint:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Install stable Rust
23+
uses: dtolnay/rust-toolchain@stable
24+
with:
25+
components: clippy
26+
27+
- name: Cache Rust dependencies
28+
uses: Swatinem/rust-cache@v2.7.7
29+
with:
30+
env-vars: "CARGO RUST"
31+
cache-on-failure: true
32+
33+
- name: lint
34+
run: cargo clippy # instruct some packages if needed
35+
36+
build-and-release:
37+
name: Build and Release
38+
runs-on: ${{ matrix.os }}
39+
needs: [lint]
40+
strategy:
41+
matrix:
42+
include:
43+
# linux x64
44+
- os: ubuntu-latest
45+
target: x86_64-unknown-linux-gnu
46+
artifact_name: change_me
47+
asset_name: change_me-linux-amd64
48+
49+
# linux arm
50+
- os: ubuntu-latest
51+
target: aarch64-unknown-linux-gnu
52+
artifact_name: change_me
53+
asset_name: change_me-linux-arm
54+
55+
# windows x64
56+
- os: windows-latest
57+
target: x86_64-pc-windows-gnu
58+
artifact_name: change_me.exe
59+
asset_name: change_me-windows-amd64.exe
60+
61+
# windows arm
62+
- os: windows-latest
63+
target: aarch64-pc-windows-msvc
64+
artifact_name: change_me.exe
65+
asset_name: change_me-windows-arm.exe
66+
67+
# macos x64
68+
- os: macos-latest
69+
target: x86_64-apple-darwin
70+
artifact_name: change_me
71+
asset_name: change_me-macos-amd64
72+
73+
# macos arm
74+
- os: macos-latest
75+
target: aarch64-apple-darwin
76+
artifact_name: change_me
77+
asset_name: change_me-macos-arm
78+
79+
steps:
80+
- uses: actions/checkout@v4
81+
82+
- name: Install Rust
83+
run: rustup toolchain install stable --profile minimal
84+
85+
- name: Add target
86+
run: rustup target add ${{ matrix.target }}
87+
88+
- name: Install Linux ARM dependencies
89+
if: matrix.target == 'aarch64-unknown-linux-gnu'
90+
run: |
91+
sudo apt-get update
92+
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
93+
94+
- name: Set linker for Linux ARM
95+
if: matrix.target == 'aarch64-unknown-linux-gnu'
96+
run: |
97+
echo '[target.aarch64-unknown-linux-gnu]' >> ~/.cargo/config.toml
98+
echo 'linker = "aarch64-linux-gnu-gcc"' >> ~/.cargo/config.toml
99+
100+
- uses: Swatinem/rust-cache@v2
101+
with:
102+
prefix-key: "v0-rust"
103+
shared-key: "${{ matrix.target }}"
104+
cache-on-failure: "true"
105+
cache-all-crates: "true"
106+
workspaces: |
107+
. -> target
108+
cache-targets: "true"
109+
110+
- name: Build
111+
uses: actions-rs/cargo@v1
112+
with:
113+
command: build
114+
args: --release --target ${{ matrix.target }}
115+
116+
- name: Prepare artifact
117+
shell: bash
118+
run: |
119+
mkdir -p artifacts
120+
if [ "${{ matrix.os }}" = "windows-latest" ]; then
121+
cp "target/${{ matrix.target }}/release/${{ matrix.artifact_name }}" "artifacts/${{ matrix.asset_name }}"
122+
else
123+
cp "target/${{ matrix.target }}/release/${{ matrix.artifact_name }}" "artifacts/${{ matrix.asset_name }}"
124+
fi
125+
126+
- name: Upload artifact
127+
uses: actions/upload-artifact@v4
128+
with:
129+
name: ${{ matrix.asset_name }}
130+
path: artifacts/${{ matrix.asset_name }}
131+
132+
create-release:
133+
needs: build-and-release
134+
runs-on: ubuntu-latest
135+
steps:
136+
- name: Download artifacts
137+
uses: actions/download-artifact@v4
138+
139+
- name: Create Release
140+
id: create_release
141+
uses: softprops/action-gh-release@v2
142+
with:
143+
files: |
144+
change_me-linux-amd64/change_me-linux-amd64
145+
change_me-windows-amd64.exe/change_me-windows-amd64.exe
146+
change_me-macos-amd64/change_me-macos-amd64
147+
change_me-linux-arm/change_me-linux-arm
148+
change_me-windows-arm.exe/change_me-windows-arm.exe
149+
change_me-macos-arm/change_me-macos-arm
150+
draft: false
151+
prerelease: false
152+
generate_release_notes: true
153+
append_bode: true
154+
make_latest: true
155+
env:
156+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/lint.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches:
6+
# change for your branch name
7+
- main
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
BINARY_NAME: change_me
12+
13+
jobs:
14+
lint:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Install stable Rust
20+
uses: dtolnay/rust-toolchain@stable
21+
with:
22+
components: clippy
23+
24+
- name: Cache Rust dependencies
25+
uses: Swatinem/rust-cache@v2.7.7
26+
with:
27+
env-vars: "CARGO RUST"
28+
cache-on-failure: true
29+
30+
- name: lint
31+
run: cargo clippy # instruct some packages if needed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
debug
2+
**/target
3+
**/dist
4+
**/.DS_Store
5+
**/Cargo.lock

Cargo.toml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
2+
[package]
3+
name = "change_me"
4+
version = "0.0.1"
5+
edition = "2024"
6+
authors = ["TOwInOK <60252419+TOwInOK@users.noreply.github.com>"]
7+
repository = "change_me"
8+
license = "MIT" #"Apache-2.0"
9+
10+
[dependencies]
11+
# serde = { version = "^1", features = ["derive"] }
12+
# serde_json = { version = "1" }
13+
# ron = "^0.10"
14+
# tracing = "^0.1"
15+
# tracing-subscriber = "^0.3"
16+
# anyhow = "^1"
17+
# tokio = { version = "^1", features = ["full"] }
18+
# thiserror = "^2"
19+
20+
21+
[profile.dev]
22+
opt-level = 0
23+
debug = true
24+
strip = "none"
25+
debug-assertions = true
26+
overflow-checks = true
27+
lto = false
28+
panic = 'unwind'
29+
incremental = true
30+
codegen-units = 256
31+
rpath = false
32+
33+
[profile.release]
34+
opt-level = 'z'
35+
debug = false
36+
lto = true
37+
codegen-units = 24
38+
panic = 'abort'
39+
strip = true
40+
incremental = true
41+
debug-assertions = false
42+
overflow-checks = false
43+
44+
[profile.test]
45+
opt-level = 0
46+
debug = true
47+
48+
[profile.bench]
49+
opt-level = 3
50+
debug = false
51+
52+
[profile.wasm-release]
53+
inherits = "release"
54+
opt-level = 'z'
55+
lto = true
56+
codegen-units = 1

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 TOwInOK#nqcq
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# rust-template-default
2+
Default project template for rust project with my credentials
3+
4+
# Contains
5+
- CI/CD pipeline on tag `v*.*.*`
6+
- CI link on every push
7+
- Test folder
8+
- License (MIT)
9+
- .env file
10+
- Configurated Cargo.toml
11+
- Configurated .gitignore
12+
- Configurated .rust-toolchain.toml
13+
- Configurated .rustfmt.toml
14+
15+
---
16+
17+
# Name of packet
18+
19+
## Description
20+
21+
## How to use
22+
```sh
23+
24+
```
25+
26+
## Examples
27+
28+
## How to build
29+
```sh
30+
git clone repo-url
31+
cd repo-name
32+
cargo build
33+
```
34+
35+
## License
36+
MIT License

rust-toolchain.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[toolchain]
2+
channel = "stable"

rustfmt.toml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
max_width = 100
3+
fn_params_layout = "Vertical"
4+
array_width = 60
5+
attr_fn_like_width = 70
6+
chain_width = 60
7+
fn_call_width = 60
8+
struct_lit_width = 10
9+
struct_variant_width = 35
10+
11+
use_small_heuristics = "Max"
12+
13+
use_field_init_shorthand = true
14+
use_try_shorthand = true
15+
16+
match_block_trailing_comma = false
17+
18+
match_arm_leading_pipes = "Preserve"
19+
20+
reorder_imports = true
21+
reorder_modules = true
22+
23+
remove_nested_parens = true

src/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
println!("bruh...");
3+
}

0 commit comments

Comments
 (0)