Skip to content

Commit

Permalink
Merge pull request #221 from marcelvriend/fix/manifest-version
Browse files Browse the repository at this point in the history
Fix update version number in manifest file
  • Loading branch information
isabellaalstrom authored Jun 2, 2022
2 parents 1596d58 + 1b5a79e commit 64c8d96
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
31 changes: 17 additions & 14 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@ on:

jobs:
release_zip_file:
name: Prepare release asset
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

# Get updated translations
- name: Download Lokalise CLI
run: |
curl -sfL https://raw.githubusercontent.com/lokalise/lokalise-cli-2-go/master/install.sh | sh
- name: Downloading translations
- name: Download latest translations with Lokalise
run: |
./bin/lokalise2 \
--token "${{ secrets.lokalise_token }}"\
Expand All @@ -28,20 +30,21 @@ jobs:
--export-sort a_z \
--original-filenames=false \
--bundle-structure %LANG_ISO%.%FORMAT%
- name: Move new translations
- name: Move downloaded translations
run: |
mkdir -p "${{ github.workspace }}/custom_components/grocy/translations/"
cp /tmp/lokalise/* "${{ github.workspace }}/custom_components/grocy/translations/"
- name: "Set version numbmer"
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 }}"' "${{ github.workspace }}/custom_components/grocy/const.py"
sed -i 's|refs/heads/||' "${{ github.workspace }}/custom_components/grocy/const.py"
sed -i 's|refs/tags/||' "${{ github.workspace }}/custom_components/grocy/const.py"
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"
# Pack the Grocy dir as a zip and upload to the release
- name: ZIP Grocy Dir
- name: Add Grocy folder to zip archive
run: |
cd "${{ github.workspace }}/custom_components/grocy"
cd "${{ env.GROCY_ROOT_DIR }}"
zip grocy.zip -r ./
- name: Upload release asset
Expand All @@ -50,6 +53,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: "${{ github.workspace }}/custom_components/grocy/grocy.zip"
asset_path: "${{ env.GROCY_ROOT_DIR }}/grocy.zip"
asset_name: grocy.zip
asset_content_type: application/zip
3 changes: 1 addition & 2 deletions custom_components/grocy/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Base component constants
NAME = "Grocy"
DOMAIN = "grocy"
VERSION = "v3.2.0"
VERSION = "0.0.0"

ISSUE_URL = "https://github.com/custom-components/grocy/issues"

Expand Down Expand Up @@ -73,4 +73,3 @@ class GrocyEntityIcon(str, Enum):
SHOPPING_LIST = "mdi:cart-outline"
STOCK = "mdi:fridge-outline"
TASKS = "mdi:checkbox-marked-circle-outline"

2 changes: 1 addition & 1 deletion custom_components/grocy/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"requirements": [
"pygrocy==1.2.1"
],
"version": "v3.0.1",
"version": "0.0.0",
"iot_class": "local_polling"
}

0 comments on commit 64c8d96

Please sign in to comment.