Skip to content

Commit 2ad24e2

Browse files
committed
ci: add standard workflows
1 parent d30ef92 commit 2ad24e2

65 files changed

Lines changed: 9464 additions & 1468 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
RUSTC_BOOTSTRAP=1

.github/Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM alpine:latest
2+
3+
# Accept binary names and binary dir via build-args passed by reusable workflow
4+
ARG BINARY_DIR=./docker-bins
5+
ARG SERVER_BINARY_AMD64=wind-x86_64-linux-musl
6+
ARG SERVER_BINARY_ARM64=wind-aarch64-linux-musl
7+
ARG TARGETARCH
8+
9+
# Select correct binary based on TARGETARCH using BuildKit bind mount (no layer created)
10+
RUN --mount=type=bind,source=${BINARY_DIR},target=/tmp/binaries \
11+
if [ "${TARGETARCH}" = "amd64" ]; then \
12+
cp /tmp/binaries/${SERVER_BINARY_AMD64} /usr/bin/wind; \
13+
elif [ "${TARGETARCH}" = "arm64" ]; then \
14+
cp /tmp/binaries/${SERVER_BINARY_ARM64} /usr/bin/wind; \
15+
else \
16+
echo "Unsupported TARGETARCH: ${TARGETARCH}"; exit 1; \
17+
fi && \
18+
chmod +x /usr/bin/wind
19+
20+
# Setup environment
21+
RUN mkdir -p /etc/wind
22+
23+
WORKDIR /root
24+
ENV IN_DOCKER=true
25+
26+
ENTRYPOINT [ "/usr/bin/wind" ]
27+
CMD [ "-c", "/etc/wind/config.yaml" ]

.github/cliff.toml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# git-cliff ~ default configuration file
2+
# https://git-cliff.org/docs/configuration
3+
4+
[changelog]
5+
# template for the changelog header
6+
header = """
7+
# Changelog\n
8+
All notable changes to this project will be documented in this file.\n
9+
"""
10+
# template for the changelog body
11+
# https://keats.github.io/tera/docs/#introduction
12+
body = """
13+
{% for group, commits in commits | group_by(attribute="group") %}
14+
### {{ group | striptags | trim | upper_first }}
15+
{% for commit in commits %}
16+
- {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
17+
{% if commit.breaking %}[**breaking**] {% endif %}\
18+
{{ commit.message | upper_first }}\
19+
{% if commit.remote.username %} by @{{ commit.remote.username }}{%- endif -%}\
20+
{% endfor %}
21+
{% endfor %}\n
22+
23+
24+
{% if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
25+
## New Contributors ❤️
26+
{% endif %}\
27+
{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
28+
* @{{ contributor.username }} made their first contribution
29+
{%- if contributor.pr_number %} in \
30+
[#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \
31+
{%- endif %}
32+
{%- endfor -%}
33+
34+
{% if version %}
35+
{% if previous.version %}
36+
**Full Changelog**: {{ self::remote_url() }}/compare/{{ previous.version }}...{{ version }}
37+
{% endif %}
38+
{% else -%}
39+
{% raw %}\n{% endraw %}
40+
{% endif %}
41+
42+
{%- macro remote_url() -%}
43+
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
44+
{%- endmacro -%}
45+
46+
"""
47+
# template for the changelog footer
48+
footer = """
49+
<!-- generated by git-cliff -->
50+
"""
51+
# remove the leading and trailing s
52+
trim = true
53+
# postprocessors
54+
postprocessors = [
55+
# { pattern = '<REPO>', replace = "https://github.com/orhun/git-cliff" }, # replace repository URL
56+
]
57+
58+
[git]
59+
# parse the commits based on https://www.conventionalcommits.org
60+
conventional_commits = true
61+
# filter out the commits that are not conventional
62+
filter_unconventional = false
63+
# process each line of a commit as an individual commit
64+
split_commits = false
65+
# regex for preprocessing the commit messages
66+
commit_preprocessors = [
67+
# Replace issue numbers
68+
#{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))"},
69+
# Check spelling of the commit with https://github.com/crate-ci/typos
70+
# If the spelling is incorrect, it will be automatically fixed.
71+
#{ pattern = '.*', replace_command = 'typos --write-changes -' },
72+
]
73+
# regex for parsing and grouping commits
74+
commit_parsers = [
75+
{ message = "^feat", group = "<!-- 0 -->🚀 Features" },
76+
{ message = "^fix", group = "<!-- 1 -->🐛 Bug Fixes" },
77+
{ message = "^refactor", group = "<!-- 2 -->🚜 Refactor" },
78+
{ message = "^doc", group = "<!-- 3 -->📚 Documentation" },
79+
{ message = "^perf", group = "<!-- 4 -->⚡ Performance" },
80+
{ message = "^style\\(fmt\\)", skip = true },
81+
{ message = "^style", group = "<!-- 5 -->🎨 Styling" },
82+
{ message = "^test", group = "<!-- 6 -->🧪 Testing" },
83+
{ message = "^build", group = "<!-- 7 -->🛠️ Builds" },
84+
{ message = "^chore\\(release\\): prepare for", skip = true },
85+
{ message = "^chore\\(deps.*\\)", skip = true },
86+
{ message = "^chore\\(pr\\)", skip = true },
87+
{ message = "^chore\\(pull\\)", skip = true },
88+
{ message = "^chore|^ci", group = "<!-- 8 -->⚙️ Miscellaneous Tasks" },
89+
{ body = ".*security", group = "<!-- 9 -->🛡️ Security" },
90+
{ message = "^revert", group = "<!-- 10 -->◀️ Revert" },
91+
]
92+
# filter out the commits that are not matched by commit parsers
93+
filter_commits = false
94+
# sort the tags topologically
95+
topo_order = false
96+
# sort the commits inside sections by oldest/newest order
97+
sort_commits = "oldest"

.github/dependabot.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "cargo"
4+
directory: "/"
5+
schedule:
6+
interval: monthly
7+
groups:
8+
rust-dependencies:
9+
patterns:
10+
- "*"
11+
- package-ecosystem: "github-actions"
12+
directory: "/"
13+
schedule:
14+
interval: monthly
15+
groups:
16+
actions-dependencies:
17+
patterns:
18+
- "*"

.github/target.toml

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
# Wind Build Target Configuration
2+
# This file defines the build targets and configurations used in CI/CD workflows
3+
4+
# [[target]]
5+
# os = "" # GitHub runner OS (e.g., ubuntu-latest, windows-latest, macos-14)
6+
# target = "" # Rust target triple (e.g., x86_64-unknown-linux-gnu)
7+
# release-name = "" # Name for release artifacts (e.g., x86_64-linux)
8+
# tool = "" # Optional: Build tool (e.g., "cross" for cross-compilation)
9+
# postfix = "" # Optional: Filename suffix (e.g., ".exe" for Windows, or ".dylib/.so" for libraries)
10+
# skip-test = false # Optional: Skip testing phase (true/false)
11+
# extra-args = "" # Optional: Additional cargo flags (e.g., features)
12+
# toolchain = "" # Optional: Custom Rust toolchain (defaults to inputs.rust-toolchain)
13+
# components = "" # Optional: Rust components to install (defaults to 'rustfmt, clippy')
14+
# rustflags = "" # Optional: Custom Rust compiler flags
15+
# retention-days = 3 # Optional: Number of days to retain artifacts
16+
# nasm = false # Optional: Whether to install NASM for assembly compilation
17+
# zig = "2.17" # Optional: Zig libc version for linking (if needed)
18+
19+
# ==================== Linux Targets (GNU) ====================
20+
21+
# 64-bit Linux (GNU)
22+
[[target]]
23+
os = "ubuntu-latest"
24+
target = "x86_64-unknown-linux-gnu"
25+
release-name = "x86_64-linux"
26+
tool = "cross"
27+
28+
# 32-bit Linux (GNU)
29+
[[target]]
30+
os = "ubuntu-latest"
31+
target = "i686-unknown-linux-gnu"
32+
release-name = "i686-linux"
33+
tool = "cross"
34+
35+
# ==================== Linux Targets (MUSL) ====================
36+
37+
# 64-bit Linux (MUSL - statically linked)
38+
[[target]]
39+
os = "ubuntu-latest"
40+
target = "x86_64-unknown-linux-musl"
41+
release-name = "x86_64-linux-musl"
42+
tool = "cross"
43+
44+
# 32-bit Linux (MUSL - statically linked)
45+
[[target]]
46+
os = "ubuntu-latest"
47+
target = "i686-unknown-linux-musl"
48+
release-name = "i686-linux-musl"
49+
tool = "cross"
50+
51+
# ==================== ARM Linux Targets (GNU) ====================
52+
53+
# ARM64 Linux (GNU)
54+
[[target]]
55+
os = "ubuntu-latest"
56+
target = "aarch64-unknown-linux-gnu"
57+
release-name = "aarch64-linux"
58+
tool = "cross"
59+
60+
# ARMv7 Linux (GNU - soft float ABI)
61+
[[target]]
62+
os = "ubuntu-latest"
63+
target = "armv7-unknown-linux-gnueabi"
64+
release-name = "armv7-linux"
65+
tool = "cross"
66+
67+
# ARMv7 Linux (GNU - hard float ABI)
68+
[[target]]
69+
os = "ubuntu-latest"
70+
target = "armv7-unknown-linux-gnueabihf"
71+
release-name = "armv7-linux-hf"
72+
tool = "cross"
73+
74+
# ==================== ARM Linux Targets (MUSL) ====================
75+
76+
# ARM64 Linux (MUSL - statically linked)
77+
[[target]]
78+
os = "ubuntu-latest"
79+
target = "aarch64-unknown-linux-musl"
80+
release-name = "aarch64-linux-musl"
81+
tool = "cross"
82+
83+
# ARMv7 Linux (MUSL - soft float ABI, statically linked)
84+
[[target]]
85+
os = "ubuntu-latest"
86+
target = "armv7-unknown-linux-musleabi"
87+
release-name = "armv7-linux-musl"
88+
tool = "cross"
89+
90+
# ARMv7 Linux (MUSL - hard float ABI, statically linked)
91+
[[target]]
92+
os = "ubuntu-latest"
93+
target = "armv7-unknown-linux-musleabihf"
94+
release-name = "armv7-linux-muslhf"
95+
tool = "cross"
96+
97+
# ==================== Windows Targets ====================
98+
99+
# 64-bit Windows
100+
[[target]]
101+
os = "windows-latest"
102+
target = "x86_64-pc-windows-msvc"
103+
release-name = "x86_64-windows"
104+
postfix = ".exe"
105+
106+
# 32-bit Windows
107+
[[target]]
108+
os = "windows-latest"
109+
target = "i686-pc-windows-msvc"
110+
release-name = "i686-windows"
111+
postfix = ".exe"
112+
113+
# ARM64 Windows
114+
[[target]]
115+
os = "windows-latest"
116+
target = "aarch64-pc-windows-msvc"
117+
release-name = "aarch64-windows"
118+
postfix = ".exe"
119+
skip-test = true
120+
121+
# ==================== macOS Targets ====================
122+
123+
# Intel macOS (x86_64)
124+
[[target]]
125+
os = "macos-15-intel"
126+
target = "x86_64-apple-darwin"
127+
release-name = "x86_64-darwin"
128+
129+
# Apple Silicon macOS (ARM64)
130+
[[target]]
131+
os = "macos-latest"
132+
target = "aarch64-apple-darwin"
133+
release-name = "aarch64-darwin"
134+
135+
# ==================== Other Targets ====================
136+
137+
# FreeBSD
138+
[[target]]
139+
os = "ubuntu-latest"
140+
target = "x86_64-unknown-freebsd"
141+
release-name = "x86_64-freebsd"
142+
tool = "cross"
143+
skip-test = true
144+
145+
# RISC-V 64-bit Linux
146+
[[target]]
147+
os = "ubuntu-latest"
148+
target = "riscv64gc-unknown-linux-gnu"
149+
release-name = "riscv64gc-linux"
150+
tool = "cross"
151+
152+
# LoongArch 64-bit Linux
153+
[[target]]
154+
os = "ubuntu-latest"
155+
target = "loongarch64-unknown-linux-gnu"
156+
release-name = "loongarch64-linux"
157+
tool = "cross"

.github/workflows/ci.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
tags: ["v*"]
6+
branches: ["main"]
7+
pull_request:
8+
branches: ["main"]
9+
workflow_dispatch:
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
13+
cancel-in-progress: true
14+
15+
defaults:
16+
run:
17+
shell: bash
18+
19+
env:
20+
RUST_LOG: "wind=TRACE"
21+
RUST_TOOLCHAIN: "stable"
22+
RUSTC_BOOTSTRAP: "1"
23+
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
24+
25+
jobs:
26+
build:
27+
name: Build
28+
uses: rust-proxy/workflows/.github/workflows/rust-build.yml@v1.0.10
29+
secrets:
30+
sentry-dsn: ${{ secrets.SENTRY_DSN }}
31+
with:
32+
rust-toolchain: "stable"
33+
packages: "wind"
34+
target-config-file: ".github/target.toml"
35+
rustflags: ""
36+
enable-tmate: false
37+
only-clippy-tests-on-pr: false
38+
39+
release:
40+
name: Release
41+
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')))
42+
needs: [build]
43+
uses: rust-proxy/workflows/.github/workflows/release-publish.yml@v1.0.10
44+
with:
45+
cliff-config: '.github/cliff.toml'
46+
47+
docker:
48+
name: Docker
49+
needs: [build]
50+
uses: rust-proxy/workflows/.github/workflows/docker-publish.yml@v1.0.10
51+
secrets:
52+
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
53+
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
54+
with:
55+
docker-file: '.github/Dockerfile'
56+
image-name: 'wind'
57+
platforms: 'linux/amd64,linux/arm64'
58+
binary-dir: './docker-bins'
59+
server-binary-amd64: 'wind-x86_64-linux-musl'
60+
server-binary-arm64: 'wind-aarch64-linux-musl'

.gitignore

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,5 @@
1-
# Generated by Cargo
2-
# will have compiled files and executables
31
debug/
42
target/
5-
6-
# These are backup files generated by rustfmt
73
**/*.rs.bk
8-
9-
# MSVC Windows builds of rustc generate these, which store debugging information
10-
*.pdb
11-
12-
# RustRover
13-
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
14-
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
15-
# and can be added to the global gitignore or merged into this file. For a more nuclear
16-
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
17-
#.idea/
18-
19-
# Added by cargo
20-
214
/target
5+
config.toml

0 commit comments

Comments
 (0)