-
-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7790ea6
commit 4e203d6
Showing
1 changed file
with
21 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,38 @@ | ||
--- | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
env: | ||
COMPONENT_NAME: xiaomi_cloud_map_extractor | ||
|
||
jobs: | ||
release: | ||
name: Prepare release | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
id-token: write | ||
steps: | ||
- name: Download repo | ||
uses: actions/checkout@v1 | ||
uses: actions/[email protected] | ||
|
||
- name: Adjust version number | ||
shell: bash | ||
run: | | ||
version="${{ github.event.release.tag_name }}" | ||
yq e -P -o=json \ | ||
-i ".version = \"${version}\"" \ | ||
"${{ github.workspace }}/custom_components/${{ env.COMPONENT_NAME }}/manifest.json" | ||
- name: Zip xiaomi_cloud_map_extractor dir | ||
- name: Zip ${{ env.COMPONENT_NAME }} dir | ||
run: | | ||
cd /home/runner/work/Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor/Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor/custom_components/xiaomi_cloud_map_extractor | ||
zip xiaomi_cloud_map_extractor.zip -r ./ | ||
cd "${{ github.workspace }}/custom_components/${{ env.COMPONENT_NAME }}" | ||
zip ${{ env.COMPONENT_NAME }}.zip -r ./ | ||
- name: Upload zip to release | ||
uses: svenstaro/upload-release-action@v1-release | ||
uses: softprops/action-gh-release@v2.1.0 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: /home/runner/work/Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor/Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor/custom_components/xiaomi_cloud_map_extractor/xiaomi_cloud_map_extractor.zip | ||
asset_name: xiaomi_cloud_map_extractor.zip | ||
tag: ${{ github.ref }} | ||
overwrite: true | ||
files: ${{ github.workspace }}/custom_components/${{ env.COMPONENT_NAME }}/${{ env.COMPONENT_NAME }}.zip |