Skip to content

Commit d50f255

Browse files
authored
Initial commit
0 parents  commit d50f255

File tree

11 files changed

+345
-0
lines changed

11 files changed

+345
-0
lines changed

.env

Whitespace-only changes.

.github/workflows/cli.yml

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

.github/workflows/lint.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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/[email protected]
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
32+
- name: test
33+
run: cargo test --tests --bins --examples # 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 <[email protected]>"]
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)