Skip to content

Commit 655672d

Browse files
committed
first commit
1 parent 4bed2ab commit 655672d

File tree

5 files changed

+182
-0
lines changed

5 files changed

+182
-0
lines changed

.github/workflows/actionlint.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: actionlint
2+
on:
3+
pull_request:
4+
paths:
5+
- '.github/workflows/**'
6+
7+
jobs:
8+
actionlint:
9+
name: runner / actionlint
10+
runs-on: ubuntu-22.04
11+
steps:
12+
- uses: actions/[email protected]
13+
- name: actionlint
14+
uses: reviewdog/[email protected]
15+
with:
16+
github_token: ${{ secrets.GITHUB_TOKEN }}
17+
reporter: github-pr-review
18+
filter_mode: nofilter
19+
fail_on_error: true

.github/workflows/release.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
on:
2+
push:
3+
branches:
4+
- "master"
5+
tags:
6+
- "v*"
7+
8+
env:
9+
CARGO_INCREMENTAL: 0
10+
11+
jobs:
12+
release:
13+
strategy:
14+
matrix:
15+
include:
16+
- target: x86_64-unknown-linux-gnu
17+
file: base65536
18+
output: base65536-linux.zip
19+
- target: x86_64-pc-windows-gnu
20+
file: base65536.exe
21+
output: base65536-windows.zip
22+
23+
name: release
24+
runs-on: ubuntu-24.04
25+
steps:
26+
- uses: actions/[email protected]
27+
28+
- if: ${{ matrix.target == 'x86_64-pc-windows-gnu' }}
29+
run: |
30+
sudo apt-get install -y gcc-mingw-w64-x86-64
31+
32+
- name: Get Rust toolchain
33+
id: toolchain
34+
run: |
35+
awk -F'[ ="]+' '$1 == "channel" { print "toolchain=" $2 }' rust-toolchain >> "$GITHUB_OUTPUT"
36+
37+
- name: install clippy
38+
uses: dtolnay/rust-toolchain@stable
39+
with:
40+
components: clippy
41+
toolchain: ${{ steps.toolchain.outputs.toolchain }}
42+
targets: x86_64-pc-windows-gnu
43+
44+
- uses: actions-rs/[email protected]
45+
with:
46+
toolchain: stable
47+
target: x86_64-pc-windows-gnu
48+
49+
- name: cache dependencies
50+
uses: Swatinem/[email protected]
51+
52+
- name: clippy check
53+
uses: sksat/[email protected]
54+
with:
55+
reporter: github-check
56+
57+
- name: install cargo-license
58+
run: cargo install cargo-license
59+
60+
- name: unit test
61+
run: |
62+
cargo test --no-run --locked
63+
cargo test
64+
65+
- name: build
66+
env:
67+
TARGET: ${{ matrix.target }}
68+
run:
69+
cargo build --release --target $TARGET
70+
71+
- env:
72+
TARGET: ${{ matrix.target }}
73+
FILE: ${{ matrix.file }}
74+
OUTPUT: ${{ matrix.output }}
75+
run: |
76+
mkdir base65536
77+
cargo license \
78+
--authors \
79+
--do-not-bundle \
80+
--avoid-dev-deps \
81+
--avoid-build-deps \
82+
--filter-platform $TARGET \
83+
> base65536/CREDITS
84+
VERSION_NAME=${GITHUB_REF##*/}
85+
if [[ $VERSION_NAME == "master" ]]; then
86+
VERSION_NAME=$(git rev-parse --short HEAD)
87+
elif [[ ${VERSION_NAME:0:1} == "v" ]]; then
88+
VERSION_NAME=${VERSION_NAME:1}
89+
fi
90+
echo "$VERSION_NAME" > base65536/VERSION.txt
91+
cp LICENSE README.md base65536/
92+
cp target/$TARGET/release/$FILE base65536/
93+
zip -r $OUTPUT base65536
94+
95+
- name: pre-release
96+
uses: softprops/[email protected]
97+
if: "! startsWith(github.ref, 'refs/tags/')"
98+
with:
99+
tag_name: nightly-${{ github.sha }}
100+
prerelease: true
101+
fail_on_unmatched_files: true
102+
files: |
103+
${{ matrix.output }}
104+
105+
- name: tagged-release
106+
uses: softprops/[email protected]
107+
if: startsWith(github.ref, 'refs/tags/')
108+
with:
109+
fail_on_unmatched_files: true
110+
files: |
111+
${{ matrix.output }}

.github/workflows/review.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Review
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'src/**'
7+
- 'Cargo.toml'
8+
- 'Cargo.lock'
9+
- '.github/workflows/review.yml'
10+
11+
12+
env:
13+
CARGO_INCREMENTAL: 0
14+
15+
jobs:
16+
rust:
17+
runs-on: ubuntu-22.04
18+
steps:
19+
- uses: actions/[email protected]
20+
21+
- uses: actions-rs/[email protected]
22+
with:
23+
toolchain: stable
24+
components: clippy
25+
override: true
26+
27+
- name: cache dependencies
28+
uses: Swatinem/[email protected]
29+
30+
- name: clippy check
31+
uses: actions-rs/[email protected]
32+
with:
33+
token: ${{ secrets.GITHUB_TOKEN }}
34+
args: --all-features
35+
36+
- name: compile for unit test
37+
uses: actions-rs/[email protected]
38+
with:
39+
command: test
40+
args: --no-run --locked
41+
42+
- name: unit test
43+
uses: actions-rs/[email protected]
44+
with:
45+
command: test

renovate.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extends": [
3+
"config:base"
4+
]
5+
}

rust-toolchain

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

0 commit comments

Comments
 (0)