Skip to content

Commit 81f280f

Browse files
committed
Fix release workflow YAML syntax and simplify structure
- Fixed YAML parsing errors caused by complex multiline strings - Simplified workflow structure for reliability - Removed problematic backtick and dash characters - Streamlined marketplace validation - Maintained core functionality: tag-based releases, major version updates, marketplace issues
1 parent 0b21b06 commit 81f280f

File tree

1 file changed

+11
-194
lines changed

1 file changed

+11
-194
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 194 deletions
Original file line numberDiff line numberDiff line change
@@ -36,50 +36,26 @@ jobs:
3636
fi
3737
echo "✅ action.yml found"
3838
39-
- name: Validate action structure
40-
run: |
41-
# Check if required files exist
42-
required_files=("action.yml" "Dockerfile" "entrypoint.sh" "README.md")
43-
for file in "${required_files[@]}"; do
44-
if [ ! -f "$file" ]; then
45-
echo "❌ Required file missing: $file"
46-
exit 1
47-
else
48-
echo "✅ Found: $file"
49-
fi
50-
done
51-
5239
- name: Test action locally
5340
run: |
54-
# Basic validation that the Docker image can be built
5541
echo "Testing Docker image build..."
5642
docker build -t ssh-action-test .
5743
echo "✅ Docker image built successfully"
5844
5945
- name: Generate release notes
60-
id: release_notes
6146
run: |
6247
echo "## SSH Remote Script Executor ${{ steps.version.outputs.version }}" > release_notes.md
6348
echo "" >> release_notes.md
64-
echo "### What's New" >> release_notes.md
49+
echo "### Features" >> release_notes.md
6550
echo "- Execute scripts on remote hosts via SSH" >> release_notes.md
6651
echo "- Support for custom SSH ports" >> release_notes.md
6752
echo "- Password-based authentication" >> release_notes.md
6853
echo "- Environment variables support" >> release_notes.md
6954
echo "- Comprehensive error handling" >> release_notes.md
7055
echo "" >> release_notes.md
71-
echo "### Features" >> release_notes.md
72-
echo "- ✅ Remote script execution via SSH" >> release_notes.md
73-
echo "- ✅ Configurable SSH port (default: 22)" >> release_notes.md
74-
echo "- ✅ Password authentication with sshpass" >> release_notes.md
75-
echo "- ✅ Multi-line script support" >> release_notes.md
76-
echo "- ✅ Environment variables support (comma-separated)" >> release_notes.md
77-
echo "- ✅ Proper error handling and validation" >> release_notes.md
78-
echo "- ✅ Security best practices" >> release_notes.md
79-
echo "" >> release_notes.md
8056
echo "### Usage" >> release_notes.md
8157
echo "" >> release_notes.md
82-
printf '%s\n' '```yaml' >> release_notes.md
58+
echo '```yaml' >> release_notes.md
8359
echo "- name: Execute remote script" >> release_notes.md
8460
echo " uses: ${{ github.repository }}@${{ steps.version.outputs.version }}" >> release_notes.md
8561
echo " with:" >> release_notes.md
@@ -88,33 +64,11 @@ jobs:
8864
echo ' password: ${{ secrets.SERVER_PASSWORD }}' >> release_notes.md
8965
echo " script: |" >> release_notes.md
9066
echo ' echo "Hello from remote server!"' >> release_notes.md
91-
echo " uptime" >> release_notes.md
92-
echo "" >> release_notes.md
93-
echo "# With environment variables" >> release_notes.md
94-
echo "- name: Deploy with environment variables" >> release_notes.md
95-
echo " uses: ${{ github.repository }}@${{ steps.version.outputs.version }}" >> release_notes.md
96-
echo " with:" >> release_notes.md
97-
echo ' host: ${{ secrets.SERVER_HOST }}' >> release_notes.md
98-
echo ' username: ${{ secrets.SERVER_USER }}' >> release_notes.md
99-
echo ' password: ${{ secrets.SERVER_PASSWORD }}' >> release_notes.md
100-
echo " envs: 'DEPLOY_ENV=production,APP_VERSION=1.2.3'" >> release_notes.md
101-
echo " script: |" >> release_notes.md
102-
echo ' echo "Deploying version $APP_VERSION to $DEPLOY_ENV"' >> release_notes.md
103-
echo " # Your deployment script here" >> release_notes.md
104-
printf '%s\n' '```' >> release_notes.md
67+
echo '```' >> release_notes.md
10568
echo "" >> release_notes.md
106-
echo "### Security" >> release_notes.md
107-
echo "- Always use GitHub Secrets for sensitive credentials" >> release_notes.md
108-
echo "- Never hardcode passwords in workflow files" >> release_notes.md
109-
echo "- Use principle of least privilege for SSH users" >> release_notes.md
110-
echo "" >> release_notes.md
111-
echo "See [README.md](README.md) for complete documentation and examples." >> release_notes.md
112-
113-
echo "Generated release notes:"
114-
cat release_notes.md
69+
echo "See [README.md](README.md) for complete documentation." >> release_notes.md
11570
11671
- name: Create GitHub Release
117-
id: create_release
11872
env:
11973
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12074
run: |
@@ -128,128 +82,32 @@ jobs:
12882
run: |
12983
echo "🔍 Validating GitHub Marketplace requirements..."
13084
131-
# Check if repository is public
13285
REPO_VISIBILITY=$(gh repo view ${{ github.repository }} --json visibility --jq '.visibility')
13386
if [ "$REPO_VISIBILITY" != "public" ]; then
13487
echo "⚠️ Repository is private - marketplace publication not possible"
135-
echo "📝 To publish to GitHub Marketplace:"
136-
echo " 1. Go to Settings → General → Change repository visibility"
137-
echo " 2. Click 'Change visibility' → 'Make public'"
138-
echo " 3. Re-run the release workflow after making it public"
139-
echo ""
140-
echo "🔄 Continuing with private repository release..."
141-
MARKETPLACE_READY=false
88+
echo "MARKETPLACE_READY=false" >> $GITHUB_ENV
89+
echo "marketplace-ready=false" >> $GITHUB_OUTPUT
14290
else
14391
echo "✅ Repository is public"
144-
MARKETPLACE_READY=true
145-
fi
146-
147-
# Check action.yml branding
148-
if grep -q "branding:" action.yml && grep -q "icon:" action.yml && grep -q "color:" action.yml; then
149-
echo "✅ action.yml has proper branding configuration"
150-
else
151-
echo "⚠️ action.yml missing branding configuration"
152-
echo " Add branding section to action.yml for marketplace publication"
153-
MARKETPLACE_READY=false
154-
fi
155-
156-
# Check README exists and has content
157-
if [ -f README.md ] && [ -s README.md ]; then
158-
echo "✅ README.md exists and has content"
159-
else
160-
echo "⚠️ README.md missing or empty"
161-
MARKETPLACE_READY=false
162-
fi
163-
164-
# Check for usage examples in README
165-
if grep -q "yaml" README.md && grep -q "uses:" README.md; then
166-
echo "✅ README contains usage examples"
167-
else
168-
echo "⚠️ README should include usage examples"
169-
fi
170-
171-
# Set marketplace readiness status
172-
if [ "$MARKETPLACE_READY" = "true" ]; then
173-
echo "🎯 Marketplace requirements validation complete - Ready for publication!"
17492
echo "MARKETPLACE_READY=true" >> $GITHUB_ENV
17593
echo "marketplace-ready=true" >> $GITHUB_OUTPUT
176-
else
177-
echo "⚠️ Marketplace requirements not fully met - Release will continue without marketplace publication"
178-
echo "MARKETPLACE_READY=false" >> $GITHUB_ENV
179-
echo "marketplace-ready=false" >> $GITHUB_OUTPUT
18094
fi
18195
env:
18296
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18397

184-
- name: Prepare Marketplace Metadata
185-
run: |
186-
echo "📋 Preparing marketplace metadata..."
187-
188-
# Create marketplace metadata file for reference
189-
echo '{' > marketplace-metadata.json
190-
echo ' "name": "SSH Remote Script Executor",' >> marketplace-metadata.json
191-
echo ' "description": "Execute scripts on remote hosts via SSH with password authentication",' >> marketplace-metadata.json
192-
echo ' "categories": ["Deployment", "Utilities"],' >> marketplace-metadata.json
193-
echo ' "tags": ["ssh", "remote", "deployment", "scripts", "automation"],' >> marketplace-metadata.json
194-
echo ' "suggested_keywords": [' >> marketplace-metadata.json
195-
echo ' "ssh",' >> marketplace-metadata.json
196-
echo ' "remote-execution",' >> marketplace-metadata.json
197-
echo ' "deployment",' >> marketplace-metadata.json
198-
echo ' "server-management",' >> marketplace-metadata.json
199-
echo ' "automation",' >> marketplace-metadata.json
200-
echo ' "devops"' >> marketplace-metadata.json
201-
echo ' ],' >> marketplace-metadata.json
202-
echo ' "marketplace_url": "https://github.com/marketplace/actions/ssh-remote-script-executor"' >> marketplace-metadata.json
203-
echo '}' >> marketplace-metadata.json
204-
205-
echo "✅ Marketplace metadata prepared"
206-
cat marketplace-metadata.json
207-
20898
- name: Marketplace Publication Info
20999
run: |
210100
echo "🎉 Release created successfully!"
211101
echo "📦 Version: ${{ steps.version.outputs.version }}"
212102
echo "🔗 Release URL: https://github.com/${{ github.repository }}/releases/tag/${{ steps.version.outputs.version }}"
213-
echo ""
214103
215104
if [ "$MARKETPLACE_READY" = "true" ]; then
216-
echo "🏪 MARKETPLACE PUBLICATION:"
217-
echo " 📋 All requirements validated ✅"
218-
echo " 🔗 Publication URL: https://github.com/${{ github.repository }}/releases/tag/${{ steps.version.outputs.version }}"
219-
echo ""
220-
echo "📝 To complete marketplace publication:"
221-
echo " 1. 🌐 Go to: https://github.com/${{ github.repository }}"
222-
echo " 2. 📦 Look for 'Publish this Action to the GitHub Marketplace' banner"
223-
echo " 3. 🖱️ Click the banner or go to the Releases tab"
224-
echo " 4. ✏️ Fill in the marketplace form with suggested details:"
225-
echo " - Name: SSH Remote Script Executor"
226-
echo " - Description: Execute scripts on remote hosts via SSH"
227-
echo " - Categories: Deployment, Utilities"
228-
echo " - Tags: ssh, remote, deployment, scripts, automation"
229-
echo " 5. 📤 Submit for publication"
230-
echo ""
231-
echo "🎯 The action will be reviewed and published to GitHub Marketplace!"
232-
233-
# Try to open the marketplace page (this works in some environments)
234-
echo "🔗 Attempting to open marketplace publication page..."
235-
gh repo view ${{ github.repository }} --web || echo " Manual navigation required"
105+
echo "✅ Repository is ready for marketplace publication"
106+
echo "🏪 Go to https://github.com/${{ github.repository }} to publish to marketplace"
236107
else
237-
echo "⚠️ MARKETPLACE PUBLICATION NOT AVAILABLE:"
238-
echo " 📋 Repository requirements not met"
239-
echo ""
240-
echo "📝 To enable marketplace publication:"
241-
echo " 1. 🌐 Make repository public: Settings → Change repository visibility → Make public"
242-
echo " 2. ✅ Ensure action.yml has branding configuration"
243-
echo " 3. 📖 Add comprehensive README with usage examples"
244-
echo " 4. 🔄 Create a new release after meeting requirements"
245-
echo ""
246-
echo "🎯 Release completed successfully (private repository)"
108+
echo "⚠️ Repository is private - make it public to enable marketplace publication"
247109
fi
248110
249-
echo "📊 View release: https://github.com/${{ github.repository }}/releases/tag/${{ steps.version.outputs.version }}"
250-
env:
251-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
252-
253111
# Job to create/update major version tag (e.g., v1, v2)
254112
update-major-tag:
255113
runs-on: ubuntu-latest
@@ -284,11 +142,9 @@ jobs:
284142
285143
echo "🏷️ Updating major version tag: ${{ steps.major_version.outputs.major_version }}"
286144
287-
# Delete the major version tag if it exists (both locally and remotely)
288145
git tag -d ${{ steps.major_version.outputs.major_version }} 2>/dev/null || echo "Local tag doesn't exist"
289146
git push origin :refs/tags/${{ steps.major_version.outputs.major_version }} 2>/dev/null || echo "Remote tag doesn't exist"
290147
291-
# Create new major version tag pointing to current commit
292148
git tag ${{ steps.major_version.outputs.major_version }}
293149
git push origin ${{ steps.major_version.outputs.major_version }}
294150
@@ -311,62 +167,23 @@ jobs:
311167
run: |
312168
TAG_NAME=${GITHUB_REF#refs/tags/}
313169
echo "version=$TAG_NAME" >> $GITHUB_OUTPUT
314-
echo "version_number=${TAG_NAME#v}" >> $GITHUB_OUTPUT
315170
316171
- name: Create Marketplace Publication Issue
317172
env:
318173
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
319174
run: |
320-
# Check if an issue already exists for this release
321175
EXISTING_ISSUE=$(gh issue list --repo ${{ github.repository }} --state open --search "Publish ${{ steps.version.outputs.version }} to GitHub Marketplace" --json number --jq '.[0].number' || echo "")
322176
323177
if [ -n "$EXISTING_ISSUE" ] && [ "$EXISTING_ISSUE" != "null" ]; then
324178
echo "📝 Issue already exists for this release: #$EXISTING_ISSUE"
325179
exit 0
326180
fi
327181
328-
# Create a simple issue body
329-
echo "Creating marketplace publication issue..."
330-
ISSUE_BODY="## Release ${{ steps.version.outputs.version }} Ready for Marketplace Publication
331-
332-
### Pre-publication Checklist
333-
- [x] Release created successfully
334-
- [x] Major version tag updated
335-
- [x] All marketplace requirements validated
336-
- [x] Docker image builds successfully
337-
- [x] Action metadata configured
338-
- [ ] Marketplace publication completed
339-
340-
### Marketplace Publication Steps
341-
342-
1. Navigate to Repository: https://github.com/${{ github.repository }}
343-
2. Look for 'Publish this Action to the GitHub Marketplace' banner
344-
3. Fill in the marketplace form with these details:
345-
- Name: SSH Remote Script Executor
346-
- Description: Execute scripts on remote hosts via SSH with password authentication
347-
- Categories: Deployment, Utilities
348-
- Tags: ssh, remote, deployment, scripts, automation
349-
4. Submit for publication
350-
351-
### Quick Links
352-
- Release Page: https://github.com/${{ github.repository }}/releases/tag/${{ steps.version.outputs.version }}
353-
- Repository: https://github.com/${{ github.repository }}
354-
- Documentation: https://github.com/${{ github.repository }}/blob/main/README.md
355-
356-
### Notes
357-
- This issue will be automatically closed when marketplace publication is complete
358-
- The action will be available at: uses: ${{ github.repository }}@${{ steps.version.outputs.version }}
359-
360-
Assigned to: @${{ github.actor }}
361-
Release: ${{ steps.version.outputs.version }}
362-
Status: Ready for marketplace publication"
363-
364-
# Create the issue
365182
gh issue create \
366183
--repo ${{ github.repository }} \
367184
--title "Publish ${{ steps.version.outputs.version }} to GitHub Marketplace" \
368185
--assignee ${{ github.actor }} \
369186
--label "marketplace,release" \
370-
--body "$ISSUE_BODY"
187+
--body "Release ${{ steps.version.outputs.version }} is ready for marketplace publication. Please visit the repository to publish to GitHub Marketplace."
371188
372-
echo "📝 Created marketplace publication tracking issue" echo "📝 Created marketplace publication tracking issue"
189+
echo "📝 Created marketplace publication tracking issue"

0 commit comments

Comments
 (0)