Skip to content

Commit

Permalink
Housekeeping.
Browse files Browse the repository at this point in the history
- devcontainer debug port
- pull back HA requirement to 2023.8.1
- release.yaml from grocy project
- linting manifest.json
  • Loading branch information
agittins committed Aug 23, 2023
1 parent 3687207 commit 11828a8
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 9 deletions.
8 changes: 7 additions & 1 deletion .devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@
"image": "mcr.microsoft.com/vscode/devcontainers/python:0-3.11",
"postCreateCommand": "scripts/setup",
"forwardPorts": [
8123
8123,
5678
],
"portsAttributes": {
"8123": {
"label": "Home Assistant"

//"onAutoForward": "notify"
}
"5678": {
"label": "Debugger"
//"onAutoForward": "notify"
}
},
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
name: Release

# Lifted shamelessly from https://github.com/custom-components/grocy

on:
release:
types: [published]

jobs:
release_zip_file:
name: Prepare and upload release asset
runs-on: ubuntu-latest
env:
BERMUDA_ROOT_DIR: "${{ github.workspace }}/custom_components/bermuda"
steps:
- name: Check out repository
uses: actions/checkout@v1

# - name: Download Lokalise CLI
# run: |
# curl -sfL https://raw.githubusercontent.com/lokalise/lokalise-cli-2-go/master/install.sh | sh
#
# - name: Download latest translations with Lokalise
# run: |
# ./bin/lokalise2 \
# --token "${{ secrets.lokalise_token }}"\
# --project-id "260939135f7593a05f2b79.75475372" \
# file download \
# --format json \
# --unzip-to /tmp/lokalise \
# --export-empty-as skip \
# --export-sort a_z \
# --original-filenames=false \
# --bundle-structure %LANG_ISO%.%FORMAT%
#
# - name: Move downloaded translations
# run: |
# mkdir -p "${{ env.BERMUDA_ROOT_DIR }}/translations/
# cp /tmp/lokalise/* "${{ env.BERMUDA_ROOT_DIR }}/translations/"

- name: Set release version number in files
run: |
sed -i '/VERSION = /c\VERSION = "${{ github.ref_name }}"' "${{ env.BERMUDA_ROOT_DIR }}/const.py"
(jq '.version = "${{ github.ref_name }}"' "${{ env.BERMUDA_ROOT_DIR }}/manifest.json") > "${{ env.BERMUDA_ROOT_DIR }}/manifest.json.tmp"
mv "${{ env.BERMUDA_ROOT_DIR }}/manifest.json.tmp" "${{ env.BERMUDA_ROOT_DIR }}/manifest.json"
- name: Add Bermuda folder to zip archive
run: |
cd "${{ env.BERMUDA_ROOT_DIR }}"
zip bermuda.zip -r ./
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: "${{ env.BERMUDA_ROOT_DIR }}/bermuda.zip"
asset_name: bermuda.zip
asset_content_type: application/zip
16 changes: 9 additions & 7 deletions custom_components/bermuda/manifest.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
{
"domain": "bermuda",
"name": "Bermuda BLE Triangulation",
"documentation": "https://github.com/agittins/bermuda",
"issue_tracker": "https://github.com/agittins/bermuda/issues",
"dependencies": [
"bluetooth_adapters"
],
"config_flow": true,
"iot_class": "local_polling",
"codeowners": [
"@agittins"
],
"config_flow": true,
"dependencies": [
"bluetooth_adapters",
"device_tracker"
],
"documentation": "https://github.com/agittins/bermuda",
"iot_class": "calculated",
"issue_tracker": "https://github.com/agittins/bermuda/issues",
"requirements": [
"pandas"
],
"version": "0.0.1"
}
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
colorlog==6.7.0
homeassistant==2023.8.1
homeassistant>=2023.8.1
pip>=23.2.1,<23.3
ruff==0.0.282

0 comments on commit 11828a8

Please sign in to comment.