Skip to content

Commit

Permalink
Merge pull request #111 from custom-components/fix-release
Browse files Browse the repository at this point in the history
Fix release action
  • Loading branch information
isabellaalstrom authored Nov 18, 2020
2 parents f0caf2c + 938741a commit e4971b0
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ame: Release
name: Release

on:
release:
Expand Down Expand Up @@ -30,25 +30,26 @@ jobs:
--bundle-structure %LANG_ISO%.%FORMAT%
- name: Move new translations
run: |
mkdir -p /home/runner/work/integration/integration/custom_components/grocy/translations/
cp /tmp/lokalise/* /home/runner/work/integration/integration/custom_components/grocy/translations/
mkdir -p "${{ github.workspace }}/custom_components/grocy/translations/"
cp /tmp/lokalise/* "${{ github.workspace }}/custom_components/grocy/translations/"
- name: "Set version numbmer"
run: |
sed -i '/VERSION = /c\VERSION = "${{ github.ref }}"' /home/runner/work/integration/integration/custom_components/grocy/const.py
sed -i 's|refs/heads/||' /home/runner/work/integration/integration/custom_components/grocy/const.py
sed -i 's|refs/tags/||' /home/runner/work/integration/integration/custom_components/grocy/const.py
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"
# Pack the Grocy dir as a zip and upload to the release
- name: ZIP Grocy Dir
run: |
cd /home/runner/work/integration/integration/custom_components/grocy
cd "${{ github.workspace }}/custom_components/grocy"
zip grocy.zip -r ./
- name: Upload zip to release
uses: svenstaro/upload-release-action@v1-release
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: /home/runner/work/integration/integration/custom_components/grocy/grocy.zip
upload_url: ${{ github.event.release.upload_url }}
asset_path: "${{ github.workspace }}/custom_components/grocy/grocy.zip"
asset_name: grocy.zip
tag: ${{ github.ref }}
overwrite: true
asset_content_type: application/zip

0 comments on commit e4971b0

Please sign in to comment.