Skip to content

Commit

Permalink
Add new release flow
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus committed Dec 19, 2024
1 parent bc286cf commit 97f15bc
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 89 deletions.
8 changes: 0 additions & 8 deletions .github/release-drafter.yml

This file was deleted.

18 changes: 18 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
changelog:
exclude:
labels:
- dependencies
categories:
- title: Breaking Changes 🛠
labels:
- breaking-change
- title: New Features 🎉
labels:
- enhancement
- feature
- title: Bug fixes 🐛
labels:
- bugfix
- title: Other Changes 🔄
labels:
- "*"
23 changes: 0 additions & 23 deletions .github/settings.yml

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/release-drafter.yml

This file was deleted.

85 changes: 54 additions & 31 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,47 +1,70 @@
name: Release Workflow
name: Release workflow

on:
release:
types: [published]
push:
tags:
- "[0-9]{3}.[0-9]+.[0-9]+(?:b[0-9]+)?"

premissions: {}

jobs:
release:
name: Release
prepare:
name: Prepare
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: 📥 Checkout the repository
- name: Checkout the repository
uses: actions/[email protected]

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

- name: ℹ️ Get integration information
id: information
run: |
name=$(find custom_components/ -type d -maxdepth 1 | tail -n 1 | cut -d "/" -f2)
echo "::set-output name=name::$name"
- name: 👀 Validate data
- name: Validate data
id: integration
run: |
manifestversion=$(jq -r '.version' ${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}/manifest.json)
if [ "$manifestversion" != "${{ steps.version.outputs.version }}" ]; then
echo "The version in custom_components/${{ steps.information.outputs.name }}/manifest.json was not correct"
manifestversion=$(jq -r '.version' ./custom_components/healthchecksio/manifest.json)
if [ "$manifestversion" != "${{ github.ref_name }}" ]; then
echo "The version in custom_components/healthchecksio/manifest.json was not correct"
echo "$manifestversion"
exit 1
fi
echo "version=$manifestversion" >> $GITHUB_OUTPUT
- name: Create zip file for the integration
run: |
cd "./custom_components/healthchecksio"
zip healthchecksio.zip -r ./
- name: 📦 Create zip file for the integration
- name: Upload the zip file
uses: actions/[email protected]
with:
name: healthchecksio.zip

- name: Create summary
run: |
cd "${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}"
zip ${{ steps.information.outputs.name }}.zip -r ./
echo "### Release Preparation Summary" >> $GITHUB_STEP_SUMMARY
echo "- The integration has been prepared for release" >> $GITHUB_STEP_SUMMARY
echo "- Manifest version: ${{ steps.integration.outputs.version }}" >> $GITHUB_STEP_SUMMARY
echo "- Tag name: ${{ github.tag_name }}" >> $GITHUB_STEP_SUMMARY
publish:
name: Publish
runs-on: ubuntu-latest
needs: prepare
environment:
name: publish
url: ${{ steps.release.outputs.url }}
premissions:
contents: write
steps:
- name: Download the zip file
uses: actions/[email protected]
with:
name: healthchecksio.zip

- name: 📤 Upload the zipfile as a release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release
uses: softprops/[email protected]
id: release
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
generate_release_notes: true
fail_on_unmatched_files: true
prerelease: contains(github.ref, '.0b')
files: |
healthchecksio.zip

0 comments on commit 97f15bc

Please sign in to comment.