Skip to content

2025.1.1

2025.1.1 #52

Workflow file for this run

name: Release
on:
release:
types: [published]
jobs:
release_zip_file:
name: Prepare and upload release asset
runs-on: ubuntu-latest
env:
GROCY_ROOT_DIR: "${{ github.workspace }}/custom_components/grocy"
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.GROCY_ROOT_DIR }}/translations/"
cp /tmp/lokalise/* "${{ env.GROCY_ROOT_DIR }}/translations/"
- name: Set release version number in files
run: |
sed -i '/VERSION = /c\VERSION = "${{ github.ref_name }}"' "${{ env.GROCY_ROOT_DIR }}/const.py"
(jq '.version = "${{ github.ref_name }}"' "${{ env.GROCY_ROOT_DIR }}/manifest.json") > "${{ env.GROCY_ROOT_DIR }}/manifest.json.tmp"
mv "${{ env.GROCY_ROOT_DIR }}/manifest.json.tmp" "${{ env.GROCY_ROOT_DIR }}/manifest.json"
- name: Add Grocy folder to zip archive
run: |
cd "${{ env.GROCY_ROOT_DIR }}"
zip grocy.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.GROCY_ROOT_DIR }}/grocy.zip"
asset_name: grocy.zip
asset_content_type: application/zip