Skip to content

Commit f28cf9d

Browse files
committed
Release v0.2.0
1 parent 7d3096f commit f28cf9d

4 files changed

Lines changed: 376 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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: ${{ matrix.os }}
15+
strategy:
16+
matrix:
17+
include:
18+
- target: x86_64-apple-darwin
19+
os: macos-latest
20+
- target: aarch64-apple-darwin
21+
os: macos-latest
22+
- target: x86_64-unknown-linux-gnu
23+
os: ubuntu-latest
24+
- target: aarch64-unknown-linux-gnu
25+
os: ubuntu-latest
26+
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
31+
- name: Install Rust
32+
uses: dtolnay/rust-toolchain@stable
33+
with:
34+
targets: ${{ matrix.target }}
35+
36+
- name: Install cross (Linux ARM)
37+
if: matrix.target == 'aarch64-unknown-linux-gnu'
38+
run: cargo install cross
39+
40+
- name: Build (cross)
41+
if: matrix.target == 'aarch64-unknown-linux-gnu'
42+
run: cross build --release --target ${{ matrix.target }}
43+
44+
- name: Build (native)
45+
if: matrix.target != 'aarch64-unknown-linux-gnu'
46+
run: cargo build --release --target ${{ matrix.target }}
47+
48+
- name: Package
49+
shell: bash
50+
run: |
51+
cd target/${{ matrix.target }}/release
52+
tar -czvf ../../../weasel-${{ matrix.target }}.tar.gz weasel
53+
cd ../../..
54+
55+
- name: Upload artifact
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: weasel-${{ matrix.target }}
59+
path: weasel-${{ matrix.target }}.tar.gz
60+
61+
release:
62+
name: Create Release
63+
needs: build
64+
runs-on: ubuntu-latest
65+
permissions:
66+
contents: write
67+
68+
steps:
69+
- name: Download artifacts
70+
uses: actions/download-artifact@v4
71+
with:
72+
path: artifacts
73+
74+
- name: Create Release
75+
uses: softprops/action-gh-release@v1
76+
with:
77+
files: artifacts/**/*.tar.gz
78+
generate_release_notes: true
79+
env:
80+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ A fast, Rust-based static analysis tool for Solidity smart contracts.
77
## Quick Start
88

99
```bash
10-
cargo install weasel
10+
curl -L https://raw.githubusercontent.com/slvDev/weasel/main/weaselup/install | bash
1111
cd your-project
1212
weasel run
1313
```
@@ -22,10 +22,15 @@ weasel run
2222

2323
## Installation
2424

25-
### Using Cargo (Recommended)
25+
### Using weaselup (Recommended)
2626

2727
```bash
28-
cargo install weasel
28+
curl -L https://raw.githubusercontent.com/slvDev/weasel/main/weaselup/install | bash
29+
```
30+
31+
To update:
32+
```bash
33+
weaselup
2934
```
3035

3136
### From Source
@@ -104,6 +109,7 @@ Remappings loaded in order (later overrides earlier):
104109

105110
- Auto-detects `hardhat.config.js/ts` or `truffle-config.js`
106111
- Uses `node_modules/` for dependencies
112+
- Default scope: `./contracts`
107113

108114
## Detectors
109115

weaselup/install

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
# Weasel Installer
5+
# Downloads and installs weaselup, then runs it to install weasel
6+
7+
WEASEL_DIR="${WEASEL_DIR:-$HOME/.weasel}"
8+
WEASEL_BIN_DIR="$WEASEL_DIR/bin"
9+
10+
REPO="slvDev/weasel"
11+
WEASELUP_URL="https://raw.githubusercontent.com/$REPO/main/weaselup/weaselup"
12+
13+
main() {
14+
echo "Installing weaselup..."
15+
16+
# Create directories
17+
mkdir -p "$WEASEL_BIN_DIR"
18+
19+
# Download weaselup
20+
if command -v curl &> /dev/null; then
21+
curl -fsSL "$WEASELUP_URL" -o "$WEASEL_BIN_DIR/weaselup"
22+
elif command -v wget &> /dev/null; then
23+
wget -qO "$WEASEL_BIN_DIR/weaselup" "$WEASELUP_URL"
24+
else
25+
echo "Error: curl or wget is required"
26+
exit 1
27+
fi
28+
29+
# Make executable
30+
chmod +x "$WEASEL_BIN_DIR/weaselup"
31+
32+
# Add to PATH
33+
add_to_path
34+
35+
echo ""
36+
echo "weaselup installed to $WEASEL_BIN_DIR"
37+
echo ""
38+
39+
# Run weaselup to install weasel
40+
"$WEASEL_BIN_DIR/weaselup"
41+
42+
echo ""
43+
echo "Done! Run 'weaselup' to update weasel."
44+
}
45+
46+
add_to_path() {
47+
local shell_name
48+
shell_name=$(basename "$SHELL")
49+
50+
case $shell_name in
51+
zsh)
52+
add_to_file "$HOME/.zshenv"
53+
;;
54+
bash)
55+
if [[ -f "$HOME/.bash_profile" ]]; then
56+
add_to_file "$HOME/.bash_profile"
57+
else
58+
add_to_file "$HOME/.bashrc"
59+
fi
60+
;;
61+
fish)
62+
add_to_fish
63+
;;
64+
*)
65+
echo "Note: Add $WEASEL_BIN_DIR to your PATH manually"
66+
return
67+
;;
68+
esac
69+
70+
echo "Added $WEASEL_BIN_DIR to PATH in your shell config"
71+
echo "Run 'source ~/.${shell_name}rc' or restart your terminal"
72+
}
73+
74+
add_to_file() {
75+
local file="$1"
76+
local line="export PATH=\"\$PATH:$WEASEL_BIN_DIR\""
77+
78+
# Check if already added
79+
if [[ -f "$file" ]] && grep -q "$WEASEL_BIN_DIR" "$file"; then
80+
return
81+
fi
82+
83+
echo "" >> "$file"
84+
echo "# Weasel" >> "$file"
85+
echo "$line" >> "$file"
86+
}
87+
88+
add_to_fish() {
89+
local fish_config="$HOME/.config/fish/config.fish"
90+
mkdir -p "$(dirname "$fish_config")"
91+
92+
if [[ -f "$fish_config" ]] && grep -q "$WEASEL_BIN_DIR" "$fish_config"; then
93+
return
94+
fi
95+
96+
echo "" >> "$fish_config"
97+
echo "# Weasel" >> "$fish_config"
98+
echo "fish_add_path $WEASEL_BIN_DIR" >> "$fish_config"
99+
}
100+
101+
main

0 commit comments

Comments
 (0)