Skip to content

Commit

Permalink
Fix release pipeline
Browse files Browse the repository at this point in the history
See: #5
  • Loading branch information
sco1 committed Nov 3, 2023
1 parent 78de52a commit 74e0192
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 32 deletions.
1 change: 0 additions & 1 deletion .github/workflows/release_artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ jobs:

- name: Compile skyportal lib
run: |
python -m pip install mpy-cross
python ./compile.py
- name: Build base bundle
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Changelog
Versions follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html) (`<major>`.`<minor>`.`<patch>`)

## [v1.0.0]
Initial release 🎉
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Thank you to [markleoart](https://www.fiverr.com/markleoart) for creating the ai
## Getting Started
Users are assumed have read through [Adafruit's PyPortal learning guide](https://learn.adafruit.com/adafruit-pyportal). CircuitPython v8.2 is currently in use for this repository, no other versions are evaluated.

The CircuitPython libraries in `lib` are sourced from the Official and Community bundles, which can be found on the [CircuitPython libraries page](https://learn.adafruit.com/adafruit-pyportal)

**WARNING:** In order to generate the background map tile, this project's `boot.py` modifies the boot process to allow the filesystem to be used as a writeable cache. In the unlikely event that things go horribly awry you may lose the existing contents of your device, so be sure to back them up before working with this project.

### Installation
Expand All @@ -27,9 +29,10 @@ secrets.py
```

#### From GH Release
The Skyportal [Releases page](https://github.com/sco1/skyportal/releases) contains bundled `*.tar.gz` archives, built in CI, that can be downloaded and extracted directly onto the device. Bundles come in two flavors: one pure-python implementation and one compiled `*.mpy` version, which has a decreased overall file size.
The Skyportal [Releases page](https://github.com/sco1/skyportal/releases) contains bundled `*.tar.gz` archives, built in CI, that can be downloaded and extracted directly onto the device. Bundles come in two flavors: one pure-python implementation and a compiled version, where the `skyportal` library has been [compiled to `*.mpy`](https://learn.adafruit.com/welcome-to-circuitpython/library-file-types-and-frozen-libraries#dot-mpy-library-files-3117643) and added to `lib/`.

### Secrets
### Configuration
#### Secrets
The following secrets are required for functionality:

```py
Expand All @@ -50,13 +53,13 @@ secrets = {
}
```

### Constants
#### Constants
A collection of functionality-related constants is specified in `constants.py`, which can be adjusted to suit your needs:

| Variable Name | Description | Default |
|----------------------------|-----------------------------------------------|----------|
| `MAP_CENTER_LAT` | Map center latitude, decimal degrees | `42.41` |
| `MAP_CENTER_LON` | Map center longitude, deimal degrees | `-71.17` |
| `GRID_WIDTH_MI` | Map grid width, miles | `15` |
| `SKIP_GROUND` | Skip drawing aircraft on the ground | `True` |
| `GEO_ALTITUDE_THRESHOLD_M` | Skip drawing aircraft below this GPS altitude | `20` |
| Variable Name | Description | Default |
|----------------------------|-------------------------------------------------------|----------|
| `MAP_CENTER_LAT` | Map center latitude, decimal degrees | `42.41` |
| `MAP_CENTER_LON` | Map center longitude, deimal degrees | `-71.17` |
| `GRID_WIDTH_MI` | Map grid width, miles | `15` |
| `SKIP_GROUND` | Skip drawing aircraft on the ground | `True` |
| `GEO_ALTITUDE_THRESHOLD_M` | Skip drawing aircraft below this GPS altitude, meters | `20` |
12 changes: 9 additions & 3 deletions compile.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
import platform
import subprocess
import time
from pathlib import Path

import mpy_cross

SOURCE_DIR = Path("./skyportal")
DEST_DIR = Path("./dist/lib/skyportal")

COMPILERS = {
"Windows": Path("./mpy-cross/mpy-cross.static-x64-windows-8.0.5.exe"),
"Linux": Path("./mpy-cross/mpy-cross.static-amd64-linux-8.0.5"),
"Darwin": Path("./mpy-cross/mpy-cross-macos-11-8.0.5-arm64"),
}


if __name__ == "__main__":
DEST_DIR.mkdir(parents=True, exist_ok=True)

to_compile = list(SOURCE_DIR.glob("*.py"))
print(f"Found {len(to_compile)} *.py files to compile")
for filepath in to_compile:
mpy_cross.run(filepath)
subprocess.run([COMPILERS[platform.system()], filepath])

time.sleep(1) # Lazy wait for subprocesses to finish

Expand Down
1 change: 1 addition & 0 deletions mpy-cross/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mpy-cross binaries sourced from S3: https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin/mpy-cross/
Binary file added mpy-cross/mpy-cross-macos-11-8.0.5-arm64
Binary file not shown.
Binary file added mpy-cross/mpy-cross.static-amd64-linux-8.0.5
Binary file not shown.
Binary file added mpy-cross/mpy-cross.static-x64-windows-8.0.5.exe
Binary file not shown.
18 changes: 1 addition & 17 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ flake8-bugbear = "^23.1"
flake8-docstrings = "^1.7"
flake8-fixme = "^1.1"
isort = "^5.12"
mpy-cross = "^1.20"
mypy = "^1.0"
pep8-naming = "^0.13"
pre-commit = "^3.0"
Expand Down

0 comments on commit 74e0192

Please sign in to comment.