Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Link the MSVC C runtime statically so ink.exe runs on a clean Windows install
# without the Visual C++ Redistributable (VCRUNTIME140.dll). Kept here rather
# than in release.yml so local Windows builds produce the same binary.
# Note: a RUSTFLAGS environment variable replaces these flags entirely.
[target.x86_64-pc-windows-msvc]
rustflags = ["-C", "target-feature=+crt-static"]

[target.aarch64-pc-windows-msvc]
rustflags = ["-C", "target-feature=+crt-static"]
50 changes: 47 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,25 +59,69 @@ jobs:
- name: Build deb and rpm for both arches
run: |
set -euo pipefail
printf '#!/bin/sh\necho stub\n' > ink
# Stub binary that answers `man` and `completions <shell>` like the
# real one, so packaging/stage.sh runs exactly as in release.yml.
cat > ink <<'STUB'
#!/bin/sh
case "$1" in
man) printf '.TH INK 1\n.SH NAME\nink \\- stub\n' ;;
completions) echo "# stub $2 completions for ink" ;;
*) echo stub ;;
esac
STUB
chmod +x ink
packaging/stage.sh ./ink dist
for arch in amd64 arm64; do
for fmt in deb rpm; do
VERSION=0.0.0 ARCH="$arch" nfpm package -f packaging/nfpm.yaml -p "$fmt"
done
done
rm -f ink
count=$(ls ink-md*.deb ink-md*.rpm | wc -l)
[ "$count" -eq 4 ] || { echo "expected 4 packages, got $count"; exit 1; }
set -- ink-md*.deb ink-md*.rpm
[ "$#" -eq 4 ] || { echo "expected 4 packages, got $#: $*"; exit 1; }

- name: Install and remove the deb
run: |
set -euo pipefail
sudo dpkg -i ink-md_0.0.0_amd64.deb
command -v ink
dpkg -L ink-md
for f in /usr/share/man/man1/ink.1.gz /usr/share/bash-completion/completions/ink \
/usr/share/zsh/vendor-completions/_ink /usr/share/fish/vendor_completions.d/ink.fish; do
dpkg -L ink-md | grep -qx "$f" || { echo "::error::deb is missing $f"; exit 1; }
done
sudo dpkg -r ink-md

- name: Check the rpm layout
run: |
set -euo pipefail
sudo apt-get install -y -qq rpm >/dev/null
set -- ink-md-0.0.0*.x86_64.rpm
files=$(rpm -qlp "$1")
echo "$files"
for f in /usr/bin/ink /usr/share/man/man1/ink.1.gz /usr/share/zsh/site-functions/_ink; do
printf '%s\n' "$files" | grep -qx "$f" || { echo "::error::rpm is missing $f"; exit 1; }
done

# Keep the declared minimum Rust version honest: build with exactly the
# `rust-version` from Cargo.toml so a dependency bump that needs a newer
# compiler fails here instead of for users on that toolchain.
msrv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Read rust-version
id: msrv
run: |
v=$(sed -n 's/^rust-version = "\([^"]*\)".*/\1/p' Cargo.toml)
[ -n "$v" ] || { echo "::error::no rust-version in Cargo.toml"; exit 1; }
echo "MSRV: $v"
echo "version=$v" >> "$GITHUB_OUTPUT"
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ steps.msrv.outputs.version }}
- run: cargo check --locked

audit:
runs-on: ubuntu-latest
permissions:
Expand Down
Loading
Loading