diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 5451ce5..c73a4af 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -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/checkout@v4.2.2 - - 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/action-gh-release@v2.2.0 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 \ No newline at end of file + files: ${{ github.workspace }}/custom_components/healthchecksio/healthchecksio.zip