Skip to content

Commit 69ca7d8

Browse files
authored
Create New drop-core (#101)
1 parent b942fe6 commit 69ca7d8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+4470
-627
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
run: ./integration/ark-cli-watch.sh
5757

5858
- name: Upload Release Build
59-
uses: actions/upload-artifact@v3
59+
uses: actions/upload-artifact@v4
6060
with:
6161
name: release-build-${{ matrix.os }}
6262
path: target/release/
@@ -72,7 +72,7 @@ jobs:
7272
steps:
7373
- uses: actions/checkout@v4
7474
- name: Download Build Artifacts
75-
uses: actions/download-artifact@v3
75+
uses: actions/download-artifact@v4
7676
with:
7777
name: release-build-${{ matrix.os }}
7878
path: ./release
@@ -85,6 +85,8 @@ jobs:
8585

8686
- name: Set up Gradle
8787
uses: gradle/actions/setup-gradle@v3
88+
with:
89+
gradle-version: wrapper
8890

8991
- name: Set up Android SDK
9092
uses: android-actions/setup-android@v3
@@ -96,7 +98,7 @@ jobs:
9698
ndk-version: r28-beta2
9799

98100
- name: Run Java Tests
99-
run: gradle test
101+
run: ./gradlew test
100102
working-directory: ./java
101103

102104
benchmarks:
@@ -108,7 +110,6 @@ jobs:
108110

109111
steps:
110112
- uses: actions/checkout@v4
111-
112113
- name: Run Criterion
113114
uses: boa-dev/criterion-compare-action@v3
114115
with:
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Drop Android Bindings Release
2+
3+
on:
4+
push:
5+
paths:
6+
- "drop-core/**"
7+
workflow_dispatch:
8+
9+
jobs:
10+
publish:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
packages: write
15+
16+
defaults:
17+
run:
18+
working-directory: ./drop-core/uniffi/bindings/android
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: Swatinem/rust-cache@v2
23+
24+
- name: Install Rust
25+
uses: dtolnay/rust-toolchain@stable
26+
with:
27+
targets: aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
28+
29+
- name: Install NDK
30+
run: cargo install cargo-ndk
31+
32+
- name: Install JDK
33+
uses: actions/[email protected]
34+
with:
35+
distribution: "temurin"
36+
java-version: "22"
37+
38+
- name: Set up Gradle
39+
uses: gradle/actions/setup-gradle@v4
40+
41+
- name: Set up Android SDK
42+
uses: android-actions/setup-android@v3
43+
44+
- name: Set up Android NDK
45+
uses: nttld/setup-ndk@v1
46+
with:
47+
link-to-sdk: true
48+
ndk-version: r29-beta2
49+
50+
- name: Set RELEASE_VERSION
51+
run: echo "RELEASE_VERSION=$GITHUB_RUN_ID" >> $GITHUB_ENV
52+
53+
- name: Publish Bindings Android
54+
run: ./gradlew publish -Pandroid.useAndroidX=true
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
RELEASE_VERSION: ${{ env.RELEASE_VERSION }}
Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
name: Drop CLI Release
2+
3+
on:
4+
push:
5+
paths:
6+
- "drop-core/**"
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
name: Build ${{ matrix.target }}
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
include:
17+
# Linux targets
18+
- os: ubuntu-latest
19+
target: x86_64-unknown-linux-gnu
20+
archive: tar.gz
21+
- os: ubuntu-latest
22+
target: x86_64-unknown-linux-musl
23+
archive: tar.gz
24+
- os: ubuntu-latest
25+
target: aarch64-unknown-linux-gnu
26+
archive: tar.gz
27+
- os: ubuntu-latest
28+
target: aarch64-unknown-linux-musl
29+
archive: tar.gz
30+
- os: ubuntu-latest
31+
target: armv7-unknown-linux-gnueabihf
32+
archive: tar.gz
33+
- os: ubuntu-latest
34+
target: armv7-unknown-linux-musleabihf
35+
archive: tar.gz
36+
37+
# Windows targets
38+
- os: windows-latest
39+
target: x86_64-pc-windows-msvc
40+
archive: zip
41+
- os: windows-latest
42+
target: i686-pc-windows-msvc
43+
archive: zip
44+
- os: windows-latest
45+
target: aarch64-pc-windows-msvc
46+
archive: zip
47+
48+
# macOS targets
49+
- os: macos-latest
50+
target: x86_64-apple-darwin
51+
archive: tar.gz
52+
- os: macos-latest
53+
target: aarch64-apple-darwin
54+
archive: tar.gz
55+
56+
steps:
57+
- name: Checkout code
58+
uses: actions/checkout@v4
59+
60+
- name: Install Rust toolchain
61+
uses: dtolnay/rust-toolchain@stable
62+
with:
63+
toolchain: 1.75.0
64+
targets: ${{ matrix.target }}
65+
66+
- name: Install additional targets
67+
run: |
68+
rustup target add ${{ matrix.target }}
69+
70+
- name: Set up Cargo cache
71+
uses: Swatinem/rust-cache@v2
72+
with:
73+
key: ${{ matrix.target }}
74+
75+
- name: Install cross-compilation tools (Linux)
76+
if: matrix.os == 'ubuntu-latest'
77+
run: |
78+
sudo apt-get update
79+
case "${{ matrix.target }}" in
80+
aarch64-unknown-linux-gnu)
81+
sudo apt-get install -y gcc-aarch64-linux-gnu
82+
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
83+
;;
84+
aarch64-unknown-linux-musl)
85+
sudo apt-get install -y gcc-aarch64-linux-gnu musl-tools
86+
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
87+
;;
88+
armv7-unknown-linux-gnueabihf)
89+
sudo apt-get install -y gcc-arm-linux-gnueabihf
90+
echo "CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc" >> $GITHUB_ENV
91+
;;
92+
armv7-unknown-linux-musleabihf)
93+
sudo apt-get install -y gcc-arm-linux-gnueabihf musl-tools
94+
echo "CARGO_TARGET_ARMV7_UNKNOWN_LINUX_MUSLEABIHF_LINKER=arm-linux-gnueabihf-gcc" >> $GITHUB_ENV
95+
;;
96+
x86_64-unknown-linux-musl)
97+
sudo apt-get install -y musl-tools
98+
;;
99+
esac
100+
101+
- name: Build binary
102+
run: |
103+
cargo build --release --target ${{ matrix.target }} --package drop-cli
104+
105+
- name: Create archive name
106+
id: archive
107+
shell: bash
108+
run: |
109+
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
110+
VERSION="${{ github.event.inputs.version }}"
111+
else
112+
VERSION="drop-cli-v${{ github.run_id }}"
113+
VERSION="${VERSION#drop-cli-v}"
114+
fi
115+
ARCHIVE_NAME="drop-cli-${VERSION}-${{ matrix.target }}"
116+
echo "name=${ARCHIVE_NAME}" >> $GITHUB_OUTPUT
117+
echo "version=${VERSION}" >> $GITHUB_OUTPUT
118+
119+
- name: Create archive (Unix)
120+
if: matrix.archive == 'tar.gz'
121+
run: |
122+
cd target/${{ matrix.target }}/release
123+
if [ "${{ matrix.target }}" == *"windows"* ]; then
124+
BINARY_NAME="drop-cli.exe"
125+
else
126+
BINARY_NAME="drop-cli"
127+
fi
128+
tar -czf ${{ steps.archive.outputs.name }}.tar.gz ${BINARY_NAME}
129+
mv ${{ steps.archive.outputs.name }}.tar.gz ${{ github.workspace }}/
130+
131+
- name: Create archive (Windows)
132+
if: matrix.archive == 'zip'
133+
shell: pwsh
134+
run: |
135+
cd target/${{ matrix.target }}/release
136+
Compress-Archive -Path "drop-cli.exe" -DestinationPath "${{ github.workspace }}/${{ steps.archive.outputs.name }}.zip"
137+
138+
- name: Upload artifact
139+
uses: actions/upload-artifact@v4
140+
with:
141+
name: ${{ steps.archive.outputs.name }}
142+
path: ${{ steps.archive.outputs.name }}.${{ matrix.archive }}
143+
144+
release:
145+
name: Create Release
146+
needs: build
147+
runs-on: ubuntu-latest
148+
permissions:
149+
contents: write
150+
steps:
151+
- name: Checkout code
152+
uses: actions/checkout@v4
153+
154+
- name: Set version
155+
id: version
156+
run: |
157+
TAG_NAME="drop-cli-v${{ github.run_id }}"
158+
VERSION="${TAG_NAME#drop-cli-v}"
159+
echo "version=${VERSION}" >> $GITHUB_OUTPUT
160+
echo "tag=${TAG_NAME}" >> $GITHUB_OUTPUT
161+
162+
- name: Download all artifacts
163+
uses: actions/download-artifact@v4
164+
with:
165+
path: artifacts
166+
167+
- name: Create release notes
168+
id: release_notes
169+
run: |
170+
cat > release_notes.md << 'EOF'
171+
## Drop CLI ${{ steps.version.outputs.version }}
172+
173+
### Downloads
174+
175+
Choose the appropriate binary for your platform:
176+
177+
#### Linux
178+
- **x86_64 (glibc)**: `drop-cli-${{ steps.version.outputs.version }}-x86_64-unknown-linux-gnu.tar.gz`
179+
- **x86_64 (musl)**: `drop-cli-${{ steps.version.outputs.version }}-x86_64-unknown-linux-musl.tar.gz`
180+
- **ARM64 (glibc)**: `drop-cli-${{ steps.version.outputs.version }}-aarch64-unknown-linux-gnu.tar.gz`
181+
- **ARM64 (musl)**: `drop-cli-${{ steps.version.outputs.version }}-aarch64-unknown-linux-musl.tar.gz`
182+
- **ARMv7 (glibc)**: `drop-cli-${{ steps.version.outputs.version }}-armv7-unknown-linux-gnueabihf.tar.gz`
183+
- **ARMv7 (musl)**: `drop-cli-${{ steps.version.outputs.version }}-armv7-unknown-linux-musleabihf.tar.gz`
184+
185+
#### Windows
186+
- **x86_64**: `drop-cli-${{ steps.version.outputs.version }}-x86_64-pc-windows-msvc.zip`
187+
- **x86**: `drop-cli-${{ steps.version.outputs.version }}-i686-pc-windows-msvc.zip`
188+
- **ARM64**: `drop-cli-${{ steps.version.outputs.version }}-aarch64-pc-windows-msvc.zip`
189+
190+
#### macOS
191+
- **Intel (x86_64)**: `drop-cli-${{ steps.version.outputs.version }}-x86_64-apple-darwin.tar.gz`
192+
- **Apple Silicon (ARM64)**: `drop-cli-${{ steps.version.outputs.version }}-aarch64-apple-darwin.tar.gz`
193+
194+
### Installation
195+
196+
1. Download the appropriate binary for your platform
197+
2. Extract the archive
198+
3. Move the binary to a location in your PATH (e.g., `/usr/local/bin` on Unix systems)
199+
4. Make it executable (Unix systems): `chmod +x drop-cli`
200+
201+
### Usage
202+
203+
Run `drop-cli --help` to see available commands and options.
204+
EOF
205+
206+
- name: Create or update release
207+
uses: softprops/action-gh-release@v1
208+
with:
209+
tag_name: ${{ steps.version.outputs.tag }}
210+
name: Drop CLI ${{ steps.version.outputs.version }}
211+
body_path: release_notes.md
212+
files: artifacts/drop-cli-*/*
213+
draft: false
214+
prerelease: false
215+
env:
216+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Cargo.toml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ members = [
1313
"fs-index",
1414
"fs-storage",
1515
"dev-hash",
16-
"drop-core",
16+
"drop-core/cli",
17+
"drop-core/exchanges/common",
18+
"drop-core/exchanges/sender",
19+
"drop-core/exchanges/receiver",
20+
"drop-core/uniffi",
1721
]
1822

1923
default-members = [
@@ -30,7 +34,11 @@ default-members = [
3034
"fs-index",
3135
"fs-storage",
3236
"dev-hash",
33-
"drop-core",
37+
"drop-core/cli",
38+
"drop-core/exchanges/common",
39+
"drop-core/exchanges/sender",
40+
"drop-core/exchanges/receiver",
41+
"drop-core/uniffi",
3442
]
3543

3644
resolver = "2"

ark-cli/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,10 @@ fs-index = { path = "../fs-index", features = ["watch"] }
3131
fs-atomic-versions = { path = "../fs-atomic-versions" }
3232
fs-metadata = { path = "../fs-metadata" }
3333
fs-properties = { path = "../fs-properties" }
34-
drop-core = { path = "../drop-core" }
3534
fs-storage = { path = "../fs-storage" }
3635

3736
data-error = { path = "../data-error" }
3837
data-link = { path = "../data-link" }
3938
data-pdf = { path = "../data-pdf" }
4039
# Depending on `dev-hash` to get `ResourceId` reference implementations
41-
dev-hash = { path = "../dev-hash" }
40+
dev-hash = { path = "../dev-hash" }

ark-cli/src/commands/drop/mod.rs

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)