Skip to content

Commit

Permalink
updated release workflow, added lokalise
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaae committed Apr 15, 2020
1 parent 092a0b9 commit 846b487
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/generate_releasenotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from github import Github

BODY = """
[![Downloads for this release](https://img.shields.io/github/downloads/tomaae/homeassistant-mikrotik_router/{version}/total.svg)](https://github.com/tomaae/homeassistant-mikrotik_router/releases/{version})
{changes}
"""
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,50 @@ on:

jobs:

release_zip:
name: Prepare release
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2

- name: Download Lokalise CLI
run: |
curl -sSL \
"https://s3-eu-west-1.amazonaws.com/lokalise-assets/cli/lokalise-0.721-linux-amd64.tgz" \
-o ./lokalise.tgz
tar -xvzf ./lokalise.tgz
- name: Downloading translations
run: |
./lokalise \
--token "${{ secrets.LOKALISE_TOKEN }}" \
export "581188395e9778a6060128.17699416" \
--type json \
--unzip_to /tmp/lokalise \
--filter last_reviewed_only \
--export_empty skip \
--export_sort a_z
- name: Move new translations
run: |
mkdir -p /home/runner/work/homeassistant-mikrotik_router/homeassistant-mikrotik_router/custom_components/mikrotik_router/.translations/
cp /tmp/lokalise/locale/* /home/runner/work/homeassistant-mikrotik_router/homeassistant-mikrotik_router/custom_components/mikrotik_router/.translations/
- name: Zip mikrotik_router dir
run: |
cd /home/runner/work/homeassistant-mikrotik_router/homeassistant-mikrotik_router/custom_components/mikrotik_router
zip mikrotik_router.zip -r ./
- name: Upload zip to release
uses: svenstaro/upload-release-action@v1-release

with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: /home/runner/work/homeassistant-mikrotik_router/homeassistant-mikrotik_router/custom_components/mikrotik_router/mikrotik_router.zip
asset_name: mikrotik_router.zip
tag: ${{ github.ref }}
overwrite: true

releasenotes:
name: Prepare releasenotes
runs-on: ubuntu-latest
Expand Down
4 changes: 3 additions & 1 deletion hacs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
"homeassistant": "0.102.0",
"iot_class": "local_poll",
"domains": ["device_tracker", "switch", "sensor", "binary_sensor"],
"render_readme": true
"render_readme": true,
"zip_release": true,
"filename": "mikrotik_router.zip"
}

0 comments on commit 846b487

Please sign in to comment.