Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 49 additions & 21 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,80 @@ name: Create Release

on:
push:
branches: [main]
branches:
- main
- master

jobs:
create-release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Determine plugin bundle
id: get_plugin
run: |
PLUGIN_BUNDLE_PATH=$(find . -maxdepth 1 -iname "*.indigoPlugin" -type d | head -1)
if [ -z "$PLUGIN_BUNDLE_PATH" ]; then
echo "Error: No .indigoPlugin directory found in repository root." >&2
exit 1
fi
PLUGIN_BUNDLE=$(basename "$PLUGIN_BUNDLE_PATH")
echo "plugin_bundle=$PLUGIN_BUNDLE" >> $GITHUB_OUTPUT
echo "Detected plugin bundle: $PLUGIN_BUNDLE"

- name: Extract version from Info.plist
id: get_version
run: |
VERSION=$(grep -A1 '<key>PluginVersion</key>' "Netro Sprinklers.indigoPlugin/Contents/Info.plist" | grep '<string>' | sed 's/.*<string>\(.*\)<\/string>.*/\1/')
PLUGIN_BUNDLE="${{ steps.get_plugin.outputs.plugin_bundle }}"
VERSION=$(grep -A1 '<key>PluginVersion</key>' "${PLUGIN_BUNDLE}/Contents/Info.plist" | grep '<string>' | sed 's/.*<string>\(.*\)<\/string>.*/\1/')
if [ -z "$VERSION" ]; then
echo "Error: Could not extract PluginVersion from Info.plist." >&2
exit 1
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Found version: $VERSION"
echo "Extracted version: $VERSION"

- name: Check if tag already exists
id: check_tag
- name: Check if release already exists
id: check_release
run: |
VERSION="${{ steps.get_version.outputs.version }}"
if git tag -l | grep -q "^${VERSION}$"; then
if git rev-parse "v$VERSION" >/dev/null 2>&1; then
echo "exists=true" >> $GITHUB_OUTPUT
echo "Tag ${VERSION} already exists, skipping release creation"
echo "Release v$VERSION already exists, skipping."
else
echo "exists=false" >> $GITHUB_OUTPUT
echo "Tag ${VERSION} does not exist, will create release"
echo "Release v$VERSION does not exist, will create."
fi

- name: Create plugin bundle zip
if: steps.check_tag.outputs.exists == 'false'
if: steps.check_release.outputs.exists == 'false'
run: |
VERSION="${{ steps.get_version.outputs.version }}"
zip -r "Netro Sprinklers.indigoPlugin.zip" "Netro Sprinklers.indigoPlugin"
echo "Created Netro Sprinklers.indigoPlugin.zip"
PLUGIN_BUNDLE="${{ steps.get_plugin.outputs.plugin_bundle }}"
zip -r "${PLUGIN_BUNDLE}.zip" "${PLUGIN_BUNDLE}" \
-x "*.pyc" \
-x "*/__pycache__" \
-x "*/__pycache__/*" \
-x "*.sublime-project" \
-x "*.sublime-workspace" \
-x "*/.idea" \
-x "*/.idea/*" \
-x "*.bbproject" \
-x "*.bbproject/*"
echo "Created ${PLUGIN_BUNDLE}.zip"

- name: Create Release
if: steps.check_tag.outputs.exists == 'false'
uses: softprops/action-gh-release@v1
- name: Create GitHub Release
if: steps.check_release.outputs.exists == 'false'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.get_version.outputs.version }}
name: Release ${{ steps.get_version.outputs.version }}
tag_name: v${{ steps.get_version.outputs.version }}
name: Release v${{ steps.get_version.outputs.version }}
generate_release_notes: true
files: Netro Sprinklers.indigoPlugin.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
draft: false
prerelease: false
files: ${{ steps.get_plugin.outputs.plugin_bundle }}.zip
39 changes: 31 additions & 8 deletions .github/workflows/version-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,52 @@ name: Version Check

on:
pull_request:
branches: [master, main]
branches:
- main
- master

jobs:
check-version:
runs-on: ubuntu-latest
steps:
- name: Checkout
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Determine plugin bundle
id: get_plugin
run: |
PLUGIN_BUNDLE_PATH=$(find . -maxdepth 1 -iname "*.indigoPlugin" -type d | head -1)
if [ -z "$PLUGIN_BUNDLE_PATH" ]; then
echo "Error: No .indigoPlugin directory found in repository root." >&2
exit 1
fi
PLUGIN_BUNDLE=$(basename "$PLUGIN_BUNDLE_PATH")
echo "plugin_bundle=$PLUGIN_BUNDLE" >> $GITHUB_OUTPUT
echo "Detected plugin bundle: $PLUGIN_BUNDLE"

- name: Extract version from Info.plist
id: get_version
run: |
VERSION=$(grep -A1 '<key>PluginVersion</key>' "Netro Sprinklers.indigoPlugin/Contents/Info.plist" | grep '<string>' | sed 's/.*<string>\(.*\)<\/string>.*/\1/')
PLUGIN_BUNDLE="${{ steps.get_plugin.outputs.plugin_bundle }}"
VERSION=$(grep -A1 '<key>PluginVersion</key>' "${PLUGIN_BUNDLE}/Contents/Info.plist" | grep '<string>' | sed 's/.*<string>\(.*\)<\/string>.*/\1/')
if [ -z "$VERSION" ]; then
echo "Error: Could not extract PluginVersion from Info.plist." >&2
exit 1
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Found version: $VERSION"
echo "Extracted version: $VERSION"

- name: Check if version tag already exists
- name: Check if tag already exists
run: |
VERSION="${{ steps.get_version.outputs.version }}"
if git tag -l | grep -q "^${VERSION}$"; then
echo "::error::Version ${VERSION} already exists as a tag. Please update the version in Info.plist."
if git rev-parse "v$VERSION" >/dev/null 2>&1; then
echo "::error::Version v$VERSION already exists as a git tag. Please update the PluginVersion in Info.plist."
exit 1
fi
if git rev-parse "$VERSION" >/dev/null 2>&1; then
echo "::error::Version $VERSION already exists as a git tag. Please update the PluginVersion in Info.plist."
exit 1
fi
echo "Version ${VERSION} is unique - check passed"
echo "Version $VERSION is new and can be released."
2 changes: 1 addition & 1 deletion Netro Sprinklers.indigoPlugin/Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>PluginVersion</key>
<string>2026.5.3</string>
<string>2026.5.5</string>
<key>ServerApiVersion</key>
<string>3.6</string>
<key>IwsApiVersion</key>
Expand Down
Loading