Skip to content

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
wimb0 authored Feb 11, 2025
1 parent 70557f2 commit b70af9f
Showing 1 changed file with 24 additions and 27 deletions.
51 changes: 24 additions & 27 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,35 @@
name: Release
name: "Release"

on:
release:
types: [published]
types:
- "published"

permissions: {}

jobs:
release_zip_file:
name: Prepare release asset
runs-on: ubuntu-latest
release:
name: "Release"
runs-on: "ubuntu-latest"
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Get Version
id: get_version
run: echo "NEW_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
- name: "Checkout the repository"
uses: "actions/[email protected]"

- name: "Set version numbmer"
- name: "Adjust version number"
shell: "bash"
run: |
echo $NEW_VERSION
sed -i '/version/c\ \"version\": \"$NEW_VERSION\"' ${{ github.workspace }}/custom_components/saj_modbus/manifest.json
env:
NEW_VERSION: ${{ env.NEW_VERSION }}

# Pack the ha-saj_modbus dir as a zip and upload to the release
- name: Create Zip File
yq -i -o json '.version="${{ github.event.release.tag_name }}"' \
"${{ github.workspace }}/custom_components/saj_modbus/manifest.json"
- name: "ZIP the integration directory"
shell: "bash"
run: |
cd ${{ github.workspace }}/custom_components/saj_modbus
cd "${{ github.workspace }}/custom_components/saj_modbus"
zip home-assistant-saj-r5-modbus.zip -r ./
- name: Upload zip to release
uses: svenstaro/upload-release-action@v2
- name: "Upload the ZIP file to the release"
uses: softprops/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ github.workspace }}/custom_components/saj_modbus/home-assistant-saj-r5-modbus.zip
asset_name: home-assistant-saj-r5-modbus.zip
tag: ${{ github.ref }}
overwrite: true
files: ${{ github.workspace }}/custom_components/saj_modbus/home-assistant-saj-r5-modbus.zip

0 comments on commit b70af9f

Please sign in to comment.