Skip to content

Commit

Permalink
Update release flow
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus committed Dec 29, 2024
1 parent 2334b17 commit 1efcc91
Showing 1 changed file with 11 additions and 26 deletions.
37 changes: 11 additions & 26 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,47 +1,32 @@
name: Release Workflow
name: Release workflow

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

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout the repository
- name: Checkout the repository
uses: actions/[email protected]

- name: 🔢 Get release version
- name: Get release version
id: version
uses: home-assistant/actions/helpers/version@master

- name: ℹ️ Get integration information
id: information
- name: Validate data
run: |
name=$(find custom_components/ -type d -maxdepth 1 | tail -n 1 | cut -d "/" -f2)
echo "::set-output name=name::$name"
- name: 👀 Validate data
run: |
manifestversion=$(jq -r '.version' ${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}/manifest.json)
manifestversion=$(jq -r '.version' ${{ github.workspace }}/custom_components/healthchecksio/manifest.json)
if [ "$manifestversion" != "${{ steps.version.outputs.version }}" ]; then
echo "The version in custom_components/${{ steps.information.outputs.name }}/manifest.json was not correct"
echo "The version in custom_components/healthchecksio/manifest.json was not correct"
echo "$manifestversion"
exit 1
fi
- name: 📦 Create zip file for the integration
run: |
cd "${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}"
zip ${{ steps.information.outputs.name }}.zip -r ./
- name: 📤 Upload the zipfile as a release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload the zipfile as a release asset
uses: softprops/[email protected]
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: "${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}/${{ steps.information.outputs.name }}.zip"
asset_name: ${{ steps.information.outputs.name }}.zip
asset_content_type: application/zip
files: ${{ github.workspace }}/custom_components/healthchecksio/healthchecksio.zip

0 comments on commit 1efcc91

Please sign in to comment.