-
Notifications
You must be signed in to change notification settings - Fork 57
58 lines (50 loc) · 1.99 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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