Skip to content
Merged
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
26 changes: 24 additions & 2 deletions .github/workflows/release-cosmos-plugin-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,19 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Validate OPENC3_API_TOKEN
if: ${{ inputs.deploy_to_store }}
env:
OPENC3_API_TOKEN: ${{ secrets.OPENC3_API_TOKEN }}
run: |
if [ -z "$OPENC3_API_TOKEN" ]; then
echo "Error: deploy_to_store is true but the OPENC3_API_TOKEN secret is empty"
echo "Add the key to the repo secrets and pass it through, e.g."
echo " secrets:"
echo ' OPENC3_API_TOKEN: $''{{ secrets.OPENC3_API_TOKEN }}'
exit 1
fi

- name: Validate semver format
run: |
if ! echo "${{ inputs.version }}" | grep -E '^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?(\+[a-zA-Z0-9.-]+)?$'; then
Expand Down Expand Up @@ -198,8 +211,17 @@ jobs:
else
TAG_NAME="${{ steps.plugin_info.outputs.plugin_name }}/v${{ inputs.version }}"
fi
git tag -a "$TAG_NAME" -m "Release ${{ steps.plugin_info.outputs.plugin_name }} version ${{ inputs.version }}"
git push origin "$TAG_NAME"

git fetch --tags

if git rev-parse "$TAG_NAME" >/dev/null 2>&1; then
echo "Tag $TAG_NAME already exists, skipping tag creation"
else
git tag -a "$TAG_NAME" -m "Release ${{ steps.plugin_info.outputs.plugin_name }} version ${{ inputs.version }}"
git push origin "$TAG_NAME"
echo "Created and pushed tag $TAG_NAME"
fi

echo "tag_name=$TAG_NAME" >> "$GITHUB_OUTPUT"
id: tag_info

Expand Down
Loading