Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
breakingsystems committed Feb 21, 2022
0 parents commit ab7a3a9
Show file tree
Hide file tree
Showing 184 changed files with 41,444 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**OpenHaystack version:**
[e.g. 0.3.4] (copy from _OpenHaystack → About OpenHaystack_)

**macOS version:**
[e.g. 11.3]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/general-question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: General question
about: Ask a question
title: ''
labels: question
assignees: ''

---


38 changes: 38 additions & 0 deletions .github/actions/build-esp-idf/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: 'Build Firmware with ESP-IDF'
description: 'Builds a firmware for the ESP32 using the ESP-IDF'
inputs:
src-dir:
description: 'Source directory for the ESP-IDF project'
required: true
out-dir:
description: 'Directory to which bin files will be written'
required: true
app-name:
description: 'Name of the IDF application/main binary'
required: true
runs:
using: "composite"
steps:
- name: Prepare ESP-IDF
shell: bash
run: |
sudo apt update
sudo apt install git wget flex bison gperf python3 python3-pip python3-setuptools cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0
mkdir -p /opt/esp
cd /opt/esp
git clone --recursive --depth 1 --branch release/v4.3 https://github.com/espressif/esp-idf.git
cd /opt/esp/esp-idf
./install.sh
- name: Build firmware
shell: bash
run: |
source /opt/esp/esp-idf/export.sh
cd ${{ inputs.src-dir }}
idf.py build
- name: Bundle output files
shell: bash
run: |
mkdir -p "${{ inputs.out-dir }}/bootloader" "${{ inputs.out-dir }}/partition_table"
cp "${{ inputs.src-dir }}/build/bootloader/bootloader.bin" "${{ inputs.out-dir }}/bootloader/bootloader.bin"
cp "${{ inputs.src-dir }}/build/partition_table/partition-table.bin" "${{ inputs.out-dir }}/partition_table/partition-table.bin"
cp "${{ inputs.src-dir }}/build/${{ inputs.app-name }}.bin" "${{ inputs.out-dir }}/${{ inputs.app-name }}.bin"
53 changes: 53 additions & 0 deletions .github/workflows/build-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: "Build application"

on:
push:
branches: [ main ]
paths:
- OpenHaystack/**
pull_request:
branches: [ main ]
paths:
- OpenHaystack/**

env:
APP: OpenHaystack
defaults:
run:
working-directory: OpenHaystack

jobs:
format-swift:
runs-on: macos-11
steps:
- name: "Checkout code"
uses: actions/checkout@v2
- name: "Install swift-format"
run: brew install swift-format
- name: "Run swift-format"
run: swift-format lint --recursive .

format-objc:
runs-on: macos-latest
steps:
- name: "Checkout code"
uses: actions/checkout@v2
- name: "Install clang-format"
run: brew install clang-format
- name: "Run clang-format"
run: clang-format -n **/*.{h,m}

build-app:
runs-on: macos-latest
needs:
- format-swift
- format-objc
steps:
- name: "Checkout code"
uses: actions/checkout@v2
- name: "Select Xcode 13"
uses: devbotsxyz/xcode-select@v1
with:
version: "13"
- name: "Archive project"
run: xcodebuild archive -scheme ${APP} -configuration release -archivePath ${APP}.xcarchive
54 changes: 54 additions & 0 deletions .github/workflows/build-cve-2020-9986.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: "Build CVE-2020-9986"

on:
push:
branches: [ main ]
paths:
- CVE-2020-9986/**
pull_request:
branches: [ main ]
paths:
- CVE-2020-9986/**

defaults:
run:
working-directory: CVE-2020-9986/OFReadKeys

jobs:
lint-swiftlint:
runs-on: macos-11
steps:
- name: "Checkout code"
uses: actions/checkout@v2
- name: "Run SwiftLint"
run: swiftlint --reporter github-actions-logging

build-ofreadkeys:
runs-on: macos-latest
needs: lint-swiftlint
env:
APP: OFReadKeys
steps:
- name: "Checkout code"
uses: actions/checkout@v2
- name: "Select Xcode 12"
uses: devbotsxyz/xcode-select@v1
with:
version: "12"
- name: "Archive project"
run: xcodebuild archive -scheme ${APP} -configuration release -archivePath ${APP}.xcarchive

build-offetchreports:
runs-on: macos-latest
needs: lint-swiftlint
env:
APP: OFFetchReports
steps:
- name: "Checkout code"
uses: actions/checkout@v2
- name: "Select Xcode 12"
uses: devbotsxyz/xcode-select@v1
with:
version: "12"
- name: "Archive project"
run: xcodebuild archive -scheme ${APP} -configuration release -archivePath ${APP}.xcarchive
28 changes: 28 additions & 0 deletions .github/workflows/build-firmware-esp32.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "Build firmware (ESP32)"

on:
push:
branches: [ main ]
paths:
- Firmware/ESP32/**
pull_request:
branches: [ main ]
paths:
- Firmware/ESP32/**

jobs:
build-firmware-esp32:
runs-on: ubuntu-latest
steps:
- name: "Checkout code"
uses: actions/checkout@v2
- name: "Copy static files"
run: |
mkdir -p archive/build
cp Firmware/ESP32/flash_esp32.sh archive/
- name: "Build ESP32 firmware"
uses: ./.github/actions/build-esp-idf
with:
src-dir: Firmware/ESP32
out-dir: archive/build
app-name: openhaystack
27 changes: 27 additions & 0 deletions .github/workflows/build-firmware.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "Build firmware"

on:
push:
branches: [ main ]
paths:
- Firmware/Microbit_v1/**
pull_request:
branches: [ main ]
paths:
- Firmware/Microbit_v1/**

defaults:
run:
working-directory: Firmware/Microbit_v1

jobs:
build-firmware:
runs-on: macos-11
steps:
- uses: actions/checkout@v2

# Build firmware image
- name: "Install build dependencies"
run: brew install --cask gcc-arm-embedded
- name: "Build firmware image"
run: make
80 changes: 80 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: "Create release"

on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
build-firmware-esp32:
runs-on: ubuntu-latest
steps:
- name: "Checkout code"
uses: actions/checkout@v2
- name: "Copy static files"
run: |
mkdir -p archive/build
cp Firmware/ESP32/flash_esp32.sh archive/
- name: "Build ESP32 firmware"
uses: ./.github/actions/build-esp-idf
with:
src-dir: Firmware/ESP32
out-dir: archive/build
app-name: openhaystack
- name: "Create archive"
uses: actions/upload-artifact@v2
with:
name: firmware-esp32
path: archive/*
retention-days: 1

build-and-release:
name: "Create release on GitHub"
runs-on: macos-11
env:
APP: OpenHaystack
PROJECT_DIR: OpenHaystack
defaults:
run:
working-directory: ${{ env.PROJECT_DIR }}
needs:
- build-firmware-esp32
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: "Select Xcode 12"
uses: devbotsxyz/xcode-select@v1
with:
version: "12"
- name: "Add ESP32 firmware"
uses: actions/download-artifact@v2
with:
name: firmware-esp32
path: "${{ env.PROJECT_DIR }}/OpenHaystack/HaystackApp/Firmwares/ESP32"
- name: "Archive project"
run: xcodebuild archive -scheme ${APP} -configuration release -archivePath ${APP}.xcarchive
- name: "Create ZIP"
run: |
pushd ${APP}.xcarchive/Products/Applications
zip -r ../../../${APP}.zip ${APP}.app
popd
- name: "Create release"
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: "Upload release asset"
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.PROJECT_DIR }}/${{ env.APP }}.zip
asset_name: ${{ env.APP }}.zip
asset_content_type: application/zip
Loading

0 comments on commit ab7a3a9

Please sign in to comment.