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
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: ci

on:
pull_request:
push:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- run: cargo fmt --all -- --check
- run: cargo test --all-targets --locked
- run: cargo clippy --all-targets --locked -- -D warnings
- name: Verify release target contract
run: |
test "$(grep -c '^ target:' .github/workflows/release.yml)" -eq 2
! grep -q 'x86_64-unknown-linux' .github/workflows/release.yml
! grep -q 'x86_64-apple-darwin' .github/workflows/release.yml
grep -q 'aarch64-apple-darwin' .github/workflows/release.yml
grep -q 'x86_64-pc-windows-msvc' .github/workflows/release.yml
- run: sh -n scripts/package-skill.sh skills/lexmount-webfetch/scripts/bootstrap.sh skills/lexmount-webfetch/scripts/doctor.sh
- run: ./scripts/package-skill.sh
- run: python3 -m zipfile --test dist/lexmount-webfetch.zip
- name: Verify SkillHub ZIP root
run: |
python3 - <<'PY'
import zipfile
with zipfile.ZipFile("dist/lexmount-webfetch.zip") as archive:
names = set(archive.namelist())
assert "SKILL.md" in names
assert not any(name.startswith("lexmount-webfetch/") for name in names)
PY
66 changes: 66 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: release

on:
push:
tags: ["v*"]

permissions:
contents: write

jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: macos-14
target: aarch64-apple-darwin
binary: webfetch-cli
suffix: ""
- os: windows-latest
target: x86_64-pc-windows-msvc
binary: webfetch-cli.exe
suffix: .exe
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- run: cargo test --locked
- run: cargo build --release --locked --target ${{ matrix.target }}
- name: Package
shell: bash
run: |
version="${GITHUB_REF_NAME#v}"
asset="webfetch-cli-v${version}-${{ matrix.target }}${{ matrix.suffix }}"
cp "target/${{ matrix.target }}/release/${{ matrix.binary }}" "$asset"
if command -v sha256sum >/dev/null; then sha256sum "$asset" > "$asset.sha256"; else shasum -a 256 "$asset" > "$asset.sha256"; fi
- uses: actions/upload-artifact@v4
with:
name: release-${{ matrix.target }}
path: webfetch-cli-v*-${{ matrix.target }}*

publish:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/download-artifact@v4
with:
pattern: release-*
merge-multiple: true
- name: Package SkillHub upload ZIP
run: |
./scripts/package-skill.sh
version="${GITHUB_REF_NAME#v}"
cp dist/lexmount-webfetch.zip "lexmount-webfetch-v${version}-skillhub.zip"
sha256sum "lexmount-webfetch-v${version}-skillhub.zip" > "lexmount-webfetch-v${version}-skillhub.zip.sha256"
- run: cat *.sha256 | sort -k2 > SHA256SUMS
- run: rm -f -- *.sha256
- uses: softprops/action-gh-release@v2
with:
files: |
webfetch-cli-v*
lexmount-webfetch-v*-skillhub.zip
SHA256SUMS
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/target/
/dist/
*.zip
Loading