Skip to content

Commit ca0e0f6

Browse files
authored
Merge pull request #1 from unredacted/v0.0.1-feasibility-slice
v0.0.1 feasibility slice: workspace, config parser, §2.1 capability probes
2 parents 5d4ed21 + f505302 commit ca0e0f6

21 files changed

Lines changed: 3608 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
RUST_BACKTRACE: short
11+
12+
jobs:
13+
check:
14+
name: fmt + clippy + test
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Install toolchain (matches rust-toolchain.toml)
20+
uses: dtolnay/rust-toolchain@stable
21+
with:
22+
components: rustfmt, clippy
23+
24+
- uses: Swatinem/rust-cache@v2
25+
26+
- name: cargo fmt --check
27+
run: cargo fmt --all --check
28+
29+
- name: cargo clippy
30+
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
31+
32+
- name: cargo test
33+
run: cargo test --workspace
34+
35+
cross-build:
36+
name: cross-build ${{ matrix.target }}
37+
runs-on: ubuntu-latest
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
target:
42+
- aarch64-unknown-linux-musl
43+
- x86_64-unknown-linux-musl
44+
- aarch64-unknown-linux-gnu
45+
- x86_64-unknown-linux-gnu
46+
steps:
47+
- uses: actions/checkout@v4
48+
49+
- name: Install toolchain
50+
uses: dtolnay/rust-toolchain@stable
51+
with:
52+
targets: ${{ matrix.target }}
53+
54+
- uses: Swatinem/rust-cache@v2
55+
with:
56+
key: ${{ matrix.target }}
57+
58+
- name: Install cross
59+
run: cargo install --locked cross
60+
61+
- name: cross build --release
62+
run: cross build --release --workspace --target ${{ matrix.target }}

.github/workflows/release.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
11+
jobs:
12+
build:
13+
name: build ${{ matrix.target }}
14+
runs-on: ubuntu-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
target:
19+
- aarch64-unknown-linux-musl
20+
- x86_64-unknown-linux-musl
21+
- aarch64-unknown-linux-gnu
22+
- x86_64-unknown-linux-gnu
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: Install toolchain
27+
uses: dtolnay/rust-toolchain@stable
28+
with:
29+
targets: ${{ matrix.target }}
30+
31+
- uses: Swatinem/rust-cache@v2
32+
with:
33+
key: release-${{ matrix.target }}
34+
35+
- name: Install cross
36+
run: cargo install --locked cross
37+
38+
- name: Build release
39+
run: cross build --release --workspace --target ${{ matrix.target }}
40+
41+
- name: Stage tarball contents
42+
run: |
43+
set -euo pipefail
44+
VERSION="${GITHUB_REF_NAME}"
45+
STEM="packetframe-${VERSION}-${{ matrix.target }}"
46+
STAGE="dist/${STEM}"
47+
mkdir -p "${STAGE}/conf"
48+
cp "target/${{ matrix.target }}/release/packetframe" "${STAGE}/"
49+
cp conf/example.conf "${STAGE}/conf/"
50+
cp LICENSE README.md VERSION "${STAGE}/"
51+
( cd dist && tar czf "${STEM}.tar.gz" "${STEM}" )
52+
( cd dist && sha256sum "${STEM}.tar.gz" > "${STEM}.tar.gz.sha256" )
53+
54+
- uses: actions/upload-artifact@v4
55+
with:
56+
name: release-${{ matrix.target }}
57+
path: |
58+
dist/*.tar.gz
59+
dist/*.sha256
60+
retention-days: 7
61+
if-no-files-found: error
62+
63+
publish:
64+
name: publish release
65+
needs: build
66+
runs-on: ubuntu-latest
67+
permissions:
68+
contents: write
69+
steps:
70+
- uses: actions/checkout@v4
71+
72+
- name: Download artifacts
73+
uses: actions/download-artifact@v4
74+
with:
75+
path: dist
76+
pattern: release-*
77+
merge-multiple: true
78+
79+
- name: Combine SHA256SUMS
80+
run: |
81+
set -euo pipefail
82+
cd dist
83+
cat *.sha256 > SHA256SUMS
84+
rm -f *.sha256
85+
86+
- name: Import GPG signing key
87+
if: ${{ env.PACKETFRAME_GPG_KEY != '' }}
88+
env:
89+
PACKETFRAME_GPG_KEY: ${{ secrets.PACKETFRAME_GPG_KEY }}
90+
run: |
91+
echo "${PACKETFRAME_GPG_KEY}" | gpg --batch --import
92+
93+
- name: Sign SHA256SUMS
94+
if: ${{ env.PACKETFRAME_GPG_KEY != '' }}
95+
env:
96+
PACKETFRAME_GPG_KEY: ${{ secrets.PACKETFRAME_GPG_KEY }}
97+
PACKETFRAME_GPG_KEY_ID: ${{ secrets.PACKETFRAME_GPG_KEY_ID }}
98+
run: |
99+
cd dist
100+
gpg --batch --yes --detach-sign --armor \
101+
--local-user "${PACKETFRAME_GPG_KEY_ID}" \
102+
--output SHA256SUMS.asc \
103+
SHA256SUMS
104+
105+
- name: Create GitHub release
106+
uses: softprops/action-gh-release@v2
107+
with:
108+
files: |
109+
dist/*.tar.gz
110+
dist/SHA256SUMS
111+
dist/SHA256SUMS.asc
112+
generate_release_notes: true
113+
draft: false
114+
prerelease: ${{ contains(github.ref_name, '-') }}

.gitignore

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Build output
2+
/target
3+
4+
# Local spec — not uploaded to the remote
5+
/SPEC.md
6+
7+
# Rust / Cargo
8+
**/*.rs.bk
9+
*.pdb
10+
11+
# IDE / editor
12+
.idea/
13+
.vscode/
14+
*.iml
15+
*.swp
16+
*.swo
17+
*~
18+
.ropeproject/
19+
20+
# macOS
21+
.DS_Store
22+
.AppleDouble
23+
.LSOverride
24+
25+
# Linux
26+
.directory
27+
.Trash-*
28+
29+
# Windows
30+
Thumbs.db
31+
ehthumbs.db
32+
Desktop.ini
33+
$RECYCLE.BIN/
34+
35+
# Env / secrets
36+
.env
37+
.env.*
38+
!.env.example
39+
40+
# Logs / crash dumps
41+
*.log
42+
**/core.*
43+
44+
# Local plan scratch from the session (kept out of the repo)
45+
/plans/

0 commit comments

Comments
 (0)