Skip to content

Commit 6ca7351

Browse files
committed
Prepare for 0.0.1 release
1 parent b891d07 commit 6ca7351

File tree

7 files changed

+37
-44
lines changed

7 files changed

+37
-44
lines changed

.github/workflows/CI.yml

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
shell: bash
3131
run: |
3232
pip install -r requirements.txt
33+
python setup.py sdist
3334
python setup.py bdist_wheel --py-limited-api=cp37
3435
pip install --force-reinstall dist/*.whl
3536
python -c "import icicle"
@@ -97,7 +98,8 @@ jobs:
9798
linux:
9899
# Skip building pull requests from the same repository
99100
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) }}
100-
runs-on: macos-latest
101+
runs-on: ubuntu-latest
102+
container: quay.io/pypa/manylinux2014_x86_64
101103
env:
102104
# Disable output buffering in an attempt to get readable errors
103105
PYTHONUNBUFFERED: '1'
@@ -107,26 +109,21 @@ jobs:
107109
with:
108110
submodules: 'true'
109111

110-
- name: Python environment
111-
uses: actions/setup-python@v4
112-
with:
113-
python-version: '3.10'
114-
115-
- name: Install Rust toolchain
116-
uses: dtolnay/rust-toolchain@stable
117-
with:
118-
targets: x86_64-unknown-linux-gnu
119-
120112
- name: Build
121113
shell: bash
122114
run: |
115+
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y && yum install -y openssl-devel
116+
export PATH="$PATH:$HOME/.cargo/bin"
117+
export PATH="/opt/python/cp38-cp38/bin:$PATH"
123118
pip install -r requirements.txt
124-
python setup.py bdist_wheel --py-limited-api=cp37
119+
python setup.py bdist_wheel --py-limited-api=cp37 --plat-name manylinux2014_x86_64
120+
auditwheel show dist/*.whl
125121
pip install --force-reinstall dist/*.whl
126122
python -c "import icicle"
127123
128124
- name: Test
129125
run: |
126+
export PATH="/opt/python/cp38-cp38/bin:$PATH"
130127
pip install -r tests/requirements.txt
131128
python tests/example.py
132129
python tests/invalid.py
@@ -138,34 +135,29 @@ jobs:
138135
path: dist
139136

140137
release:
141-
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
138+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
142139
runs-on: ubuntu-latest
143-
needs:
144-
- windows
145-
- macos
146-
- linux
140+
needs: [windows, macos, linux]
141+
permissions:
142+
contents: write
143+
discussions: write
147144
steps:
148-
- uses: actions/download-artifact@v3
145+
- name: Download wheels
146+
uses: actions/download-artifact@v3
149147
with:
150148
name: wheels
151-
152-
- name: Python environment
153-
uses: actions/setup-python@v4
154-
with:
155-
python-version: '3.10'
156-
157-
- name: Source distribution
158-
run: |
159-
python setup.py sdist
149+
path: dist
160150

161151
- name: Publish to PyPI
162152
uses: pypa/gh-action-pypi-publish@b7f401de30cb6434a1e19f805ff006643653240e # v1.8.10
163153
with:
164154
password: ${{ secrets.PYPI_API_TOKEN }}
155+
packages-dir: dist/
165156

166157
- name: Release
167158
uses: softprops/action-gh-release@c9b46fe7aad9f02afd89b12450b780f52dacfb2d # master 2023-03-26
168159
with:
169160
generate_release_notes: true
161+
files: dist/*
170162
env:
171163
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[package]
44
name = "icicle-python"
5-
version = "0.1.0"
5+
version = "0.0.1"
66
edition = "2021"
77

88
[lib]

MANIFEST.in

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
include Cargo.lock
22
include Cargo.toml
3-
include README.md
43
include build.rs
54
include requirements.txt
65
include copy-ghidra.py
76
recursive-include src *
87
recursive-include icicle-emu *
9-
recursive-include python *.py
10-
recursive-include python *.pyi
11-
recursive-include python py.typed
12-
recursive-include python/icicle/Ghidra *
8+
recursive-include python/icicle/Ghidra *
9+
recursive-include tests *

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@
22

33
This project is an easy to use Python wrapper around [icicle-emu](https://github.com/icicle-emu/icicle-emu). You can read more about Icicle in the paper: [Icicle: A Re-designed Emulator for Grey-Box Firmware Fuzzing](https://arxiv.org/pdf/2301.13346.pdf)
44

5-
## Requirements
5+
## Installation
66

7-
- [Python 3.7+](https://www.python.org/downloads/)
8-
- [Rust 1.48](https://rustup.rs/)
7+
You can install the [latest release](https://github.com/mrexodia/icicle-python/releases) from [PyPI](https://pypi.org/project/icicle-emu):
98

10-
## Building
9+
```
10+
pip -m install icicle-emu
11+
```
1112

12-
TODO: talk about the submodule
13+
## Development
1314

14-
TODO: clone ghidra and set `GHIDRA_SRC` environment variable
15+
_Note_: You need to install [Rust 1.48](https://rustup.rs) or later to build from source.
1516

1617
Set up a virtual environment:
1718

@@ -27,5 +28,5 @@ Get the dependencies and build:
2728

2829
```shell
2930
pip install -r requirements.txt
30-
maturin develop
31-
```
31+
python setup.py develop
32+
```

setup.cfg

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,7 @@ package_dir =
2727
zip_safe = False
2828
setup_requires = setuptools-rust >= 0.12.1;
2929
python_requires = >=3.7
30-
include_package_data = True
30+
31+
# Reference: https://stackoverflow.com/a/64789489/1806760
32+
[options.package_data]
33+
icicle = Ghidra/**/*

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
raise FileNotFoundError(f"Rust not found, visit https://rustup.rs for installation instructions")
1212

1313
ref_name = getenv("GITHUB_REF_NAME")
14-
if ref_name:
14+
if getenv("GITHUB_REF", "").startswith("refs/tags/") and ref_name:
1515
from pkg_resources import parse_version
1616
try:
1717
parse_version(ref_name)

0 commit comments

Comments
 (0)