Skip to content

Commit

Permalink
Merge pull request #18 from algorandfoundation/chore/rename_dist
Browse files Browse the repository at this point in the history
chore: rename dist to packages
  • Loading branch information
joe-p authored Mar 3, 2025
2 parents 82084e8 + 6ca4c69 commit 7c9d1bf
Show file tree
Hide file tree
Showing 42 changed files with 43 additions and 43 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
paths:
- crates/algo_models_ffi/**
- crates/algo_models/**
- dist/python/**
- packages/python/**
- "!*.md"
branches:
- main
Expand All @@ -16,7 +16,7 @@ on:
paths:
- crates/algo_models_ffi/**
- creates/algo_models/**
- dist/python/**
- packages/python/**
- "!*.md"
workflow_dispatch:

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/swift_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
paths:
- crates/algo_models_ffi/**
- crates/algo_models/**
- dist/swift/**
- packages/swift/**
- "!*.md"
- .github/workflows/swift_ci.yml
branches:
Expand All @@ -17,7 +17,7 @@ on:
paths:
- crates/algo_models_ffi/**
- crates/algo_models/**
- dist/swift/**
- packages/swift/**
- "!*.md"
- .github/workflows/swift_ci.yml
workflow_dispatch:
Expand Down Expand Up @@ -50,14 +50,14 @@ jobs:
- name: Install iOS Simulator
run: xcodebuild -downloadPlatform iOS
- name: Build
run: python -m dist.swift ${{ env.CRATE }}
run: python -m packages.swift ${{ env.CRATE }}
# Ideally we'd use a matrix for the platforms, but due to the limitations of Mac runners on GitHub it's probably better to just have a single job with multiple steps
- name: Test (macOS)
run: cd dist/swift/${{ env.PACKAGE }} && xcodebuild -scheme ${{ env.PACKAGE }} test -destination "platform=macOS"
run: cd packages/swift/${{ env.PACKAGE }} && xcodebuild -scheme ${{ env.PACKAGE }} test -destination "platform=macOS"
- name: Test (iOS)
run: cd dist/swift/${{ env.PACKAGE }} && xcodebuild -scheme ${{ env.PACKAGE }} test -destination "platform=iOS Simulator,name=iPhone 16,OS=latest"
run: cd packages/swift/${{ env.PACKAGE }} && xcodebuild -scheme ${{ env.PACKAGE }} test -destination "platform=iOS Simulator,name=iPhone 16,OS=latest"
- name: Test (Catalyst)
run: cd dist/swift/${{ env.PACKAGE }} && xcodebuild -scheme ${{ env.PACKAGE }} test -destination "platform=macOS,variant=Mac Catalyst"
run: cd packages/swift/${{ env.PACKAGE }} && xcodebuild -scheme ${{ env.PACKAGE }} test -destination "platform=macOS,variant=Mac Catalyst"
- name: Commit Package
uses: stefanzweifel/git-auto-commit-action@v5
if: github.event_name == 'push'
Expand Down
2 changes: 1 addition & 1 deletion crates/algo_models_ffi/tests/js/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import init, {
decodeTransaction,
getEncodedTransactionType,
Transaction,
} from "../../../../dist/typescript/algo_models";
} from "../../../../packages/typescript/algo_models";
import path from "path";

describe("algo_models WASM", async () => {
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
10 changes: 0 additions & 10 deletions dist/typescript/__main__.py

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,74 +6,74 @@
<array>
<dict>
<key>BinaryPath</key>
<string>libalgo_models_ffi.dylib</string>
<string>libalgo_models_ffi-ios-sim.dylib</string>
<key>HeadersPath</key>
<string>Headers</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>libalgo_models_ffi.dylib</string>
<string>libalgo_models_ffi-ios-sim.dylib</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>libalgo_models_ffi-ios-sim.dylib</string>
<string>libalgo_models_ffi.dylib</string>
<key>HeadersPath</key>
<string>Headers</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>libalgo_models_ffi-ios-sim.dylib</string>
<string>libalgo_models_ffi.dylib</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>libalgo_models_ffi-catalyst.dylib</string>
<string>libalgo_models_ffi-macos.dylib</string>
<key>HeadersPath</key>
<string>Headers</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-maccatalyst</string>
<string>macos-arm64_x86_64</string>
<key>LibraryPath</key>
<string>libalgo_models_ffi-catalyst.dylib</string>
<string>libalgo_models_ffi-macos.dylib</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>maccatalyst</string>
<string>macos</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>libalgo_models_ffi-macos.dylib</string>
<string>libalgo_models_ffi-catalyst.dylib</string>
<key>HeadersPath</key>
<string>Headers</string>
<key>LibraryIdentifier</key>
<string>macos-arm64_x86_64</string>
<string>ios-arm64_x86_64-maccatalyst</string>
<key>LibraryPath</key>
<string>libalgo_models_ffi-macos.dylib</string>
<string>libalgo_models_ffi-catalyst.dylib</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>macos</string>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>maccatalyst</string>
</dict>
</array>
<key>CFBundlePackageType</key>
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions dist/swift/__main__.py → packages/swift/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@
create_xcf_cmd += f" -library target/debug/lib{crate}_ffi-{fat_target_name}.dylib -headers target/debug/swift/{crate}/"

swift_package = to_pascal_case(crate)
create_xcf_cmd += f" -output dist/swift/{swift_package}/Frameworks/{crate}.xcframework"
create_xcf_cmd += f" -output packages/swift/{swift_package}/Frameworks/{crate}.xcframework"

if os.path.exists(f"dist/swift/{swift_package}/Frameworks/{crate}.xcframework"):
shutil.rmtree(f"dist/swift/{swift_package}/Frameworks/{crate}.xcframework")
if os.path.exists(f"packages/swift/{swift_package}/Frameworks/{crate}.xcframework"):
shutil.rmtree(f"packages/swift/{swift_package}/Frameworks/{crate}.xcframework")

# xcframework needs the modulemap to be named module.modulemap
os.rename(
Expand All @@ -82,6 +82,6 @@

shutil.move(
f"target/debug/swift/{crate}/{crate}.swift",
f"dist/swift/{swift_package}/Sources/{swift_package}/{swift_package}.swift",
f"packages/swift/{swift_package}/Sources/{swift_package}/{swift_package}.swift",
)
print(f"Updated {swift_package} in dist/swift/{swift_package}")
print(f"Updated {swift_package} in packages/swift/{swift_package}")
File renamed without changes.
10 changes: 10 additions & 0 deletions packages/typescript/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from .. import run, crate
import os

run(
f"wasm-pack build crates/{crate}_ffi --target web --out-dir ../../packages/typescript/{crate} -- --color always --no-default-features --features ffi_wasm"
)

# Remove the generated .gitignore file from the pkg directory
if os.path.exists(f"packages/typescript/{crate}/.gitignore"):
os.remove(f"packages/typescript/{crate}/.gitignore")
File renamed without changes.
Binary file not shown.
File renamed without changes.

0 comments on commit 7c9d1bf

Please sign in to comment.