Skip to content

Merge branch 'master' of github.com:FlyingDiver/Indigo-HA-Agent #5

Merge branch 'master' of github.com:FlyingDiver/Indigo-HA-Agent

Merge branch 'master' of github.com:FlyingDiver/Indigo-HA-Agent #5

name: Create Release
on:
push:
branches:
- main
- master
jobs:
create-release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Extract version from Info.plist
id: get_version
run: |
VERSION=$(grep -A1 '<key>PluginVersion</key>' UKTrains.indigoPlugin/Contents/Info.plist | grep '<string>' | sed 's/.*<string>\(.*\)<\/string>.*/\1/')
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Extracted version: $VERSION"
- name: Check if release already exists
id: check_release
run: |
VERSION="${{ steps.get_version.outputs.version }}"
if git rev-parse "v$VERSION" >/dev/null 2>&1; then
echo "exists=true" >> $GITHUB_OUTPUT
echo "Release v$VERSION already exists, skipping."
else
echo "exists=false" >> $GITHUB_OUTPUT
echo "Release v$VERSION does not exist, will create."
fi
- name: Create plugin bundle zip
if: steps.check_release.outputs.exists == 'false'
run: |
VERSION="${{ steps.get_version.outputs.version }}"
zip -r "UKTrains.indigoPlugin.zip" "UKTrains.indigoPlugin"
echo "Created UKTrains.indigoPlugin.zip"
- name: Create GitHub Release
if: steps.check_release.outputs.exists == 'false'
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.get_version.outputs.version }}
name: Release v${{ steps.get_version.outputs.version }}
generate_release_notes: true
draft: false
prerelease: false
files: UKTrains.indigoPlugin.zip