raycast-rsync-extension 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/publish.yml +104 -179
- package/package.json +2 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
name: Publish to
|
|
1
|
+
name: Publish to GitHub Packages
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
@@ -6,15 +6,19 @@ on:
|
|
|
6
6
|
- main
|
|
7
7
|
paths:
|
|
8
8
|
- "package.json"
|
|
9
|
-
- "
|
|
10
|
-
- "vite.config.js"
|
|
11
|
-
- "index.html"
|
|
12
|
-
- "scripts/**"
|
|
9
|
+
- "package-lock.json"
|
|
13
10
|
- "src/**"
|
|
14
|
-
- ".npmrc"
|
|
15
|
-
release:
|
|
16
|
-
types: [created]
|
|
17
11
|
workflow_dispatch:
|
|
12
|
+
inputs:
|
|
13
|
+
version_bump:
|
|
14
|
+
description: "Version bump type (patch, minor, major)"
|
|
15
|
+
required: false
|
|
16
|
+
default: "patch"
|
|
17
|
+
type: choice
|
|
18
|
+
options:
|
|
19
|
+
- patch
|
|
20
|
+
- minor
|
|
21
|
+
- major
|
|
18
22
|
|
|
19
23
|
jobs:
|
|
20
24
|
publish:
|
|
@@ -38,232 +42,153 @@ jobs:
|
|
|
38
42
|
- name: Install dependencies
|
|
39
43
|
run: npm ci
|
|
40
44
|
|
|
41
|
-
- name:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
echo "Current package version: $VERSION"
|
|
45
|
+
- name: Install jq
|
|
46
|
+
run: sudo apt-get update && sudo apt-get install -y jq
|
|
47
|
+
|
|
48
|
+
- name: Run tests
|
|
49
|
+
run: npm test
|
|
47
50
|
|
|
48
|
-
- name:
|
|
49
|
-
|
|
51
|
+
- name: Build extension
|
|
52
|
+
run: npm run build
|
|
53
|
+
|
|
54
|
+
- name: Get package info
|
|
55
|
+
id: package-info
|
|
50
56
|
run: |
|
|
57
|
+
VERSION=$(node -p "require('./package.json').version")
|
|
51
58
|
NAME=$(node -p "require('./package.json').name")
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
else
|
|
55
|
-
SCOPE=""
|
|
56
|
-
fi
|
|
59
|
+
|
|
60
|
+
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
57
61
|
echo "name=$NAME" >> $GITHUB_OUTPUT
|
|
58
|
-
echo "
|
|
59
|
-
echo "Current package name: $NAME"
|
|
60
|
-
if [ -z "$SCOPE" ]; then
|
|
61
|
-
echo "Package scope: (none - unscoped package)"
|
|
62
|
-
else
|
|
63
|
-
echo "Package scope: $SCOPE"
|
|
64
|
-
fi
|
|
62
|
+
echo "Package: $NAME@$VERSION"
|
|
65
63
|
|
|
66
|
-
- name: Check if version exists
|
|
67
|
-
id: check-
|
|
64
|
+
- name: Check if version exists
|
|
65
|
+
id: check-version
|
|
68
66
|
run: |
|
|
69
|
-
VERSION=${{ steps.package-
|
|
70
|
-
PACKAGE_NAME="${{ steps.package-
|
|
71
|
-
|
|
67
|
+
VERSION=${{ steps.package-info.outputs.version }}
|
|
68
|
+
PACKAGE_NAME="${{ steps.package-info.outputs.name }}"
|
|
69
|
+
|
|
70
|
+
# Set up GitHub Packages registry
|
|
71
|
+
npm config set registry https://npm.pkg.github.com
|
|
72
|
+
npm config set //npm.pkg.github.com/:_authToken ${{ secrets.GITHUB_TOKEN }}
|
|
73
|
+
|
|
74
|
+
if npm view "$PACKAGE_NAME@$VERSION" version >/dev/null 2>&1; then
|
|
72
75
|
echo "exists=true" >> $GITHUB_OUTPUT
|
|
73
|
-
echo "Version $VERSION already exists
|
|
76
|
+
echo "Version $VERSION already exists, skipping publish"
|
|
74
77
|
else
|
|
75
78
|
echo "exists=false" >> $GITHUB_OUTPUT
|
|
76
|
-
echo "Version $VERSION is new
|
|
79
|
+
echo "Version $VERSION is new, will publish"
|
|
77
80
|
fi
|
|
78
81
|
continue-on-error: true
|
|
79
82
|
|
|
80
|
-
- name:
|
|
81
|
-
|
|
83
|
+
- name: Publish to GitHub Packages
|
|
84
|
+
if: steps.check-version.outputs.exists == 'false'
|
|
82
85
|
run: |
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
+
PACKAGE_NAME="${{ steps.package-info.outputs.name }}"
|
|
87
|
+
VERSION=${{ steps.package-info.outputs.version }}
|
|
88
|
+
OWNER="${{ github.repository_owner }}"
|
|
86
89
|
|
|
87
|
-
|
|
88
|
-
echo "Package is unscoped; GitHub Packages publish requires a scope. Skipping GitHub Packages checks."
|
|
89
|
-
echo "exists=true" >> $GITHUB_OUTPUT
|
|
90
|
-
exit 0
|
|
91
|
-
fi
|
|
90
|
+
echo "Publishing $PACKAGE_NAME@$VERSION to GitHub Packages..."
|
|
92
91
|
|
|
93
|
-
npm
|
|
92
|
+
# Configure npm to use GitHub Packages registry
|
|
93
|
+
npm config set registry https://npm.pkg.github.com
|
|
94
94
|
npm config set //npm.pkg.github.com/:_authToken ${{ secrets.GITHUB_TOKEN }}
|
|
95
|
-
if npm view "$PACKAGE_NAME@$VERSION" version --registry=https://npm.pkg.github.com >/dev/null 2>&1; then
|
|
96
|
-
echo "exists=true" >> $GITHUB_OUTPUT
|
|
97
|
-
echo "Version $VERSION already exists on GitHub Packages, will skip GitHub Packages publish"
|
|
98
|
-
else
|
|
99
|
-
echo "exists=false" >> $GITHUB_OUTPUT
|
|
100
|
-
echo "Version $VERSION is new on GitHub Packages, will publish"
|
|
101
|
-
fi
|
|
102
|
-
continue-on-error: true
|
|
103
95
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
96
|
+
# For unscoped packages, GitHub Packages requires the package to be published
|
|
97
|
+
# with the owner namespace. We'll temporarily modify package.json for publishing.
|
|
98
|
+
cp package.json package.json.backup
|
|
99
|
+
jq --arg owner "$OWNER" --arg name "$PACKAGE_NAME" \
|
|
100
|
+
'.name = ("@" + $owner + "/" + $name)' package.json > package.json.temp
|
|
101
|
+
mv package.json.temp package.json
|
|
107
102
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
if: steps.check-npmjs.outputs.exists == 'false'
|
|
111
|
-
id: publish-npmjs
|
|
112
|
-
run: |
|
|
113
|
-
PACKAGE_NAME="${{ steps.package-name.outputs.name }}"
|
|
114
|
-
npm config set registry https://registry.npmjs.org
|
|
115
|
-
npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
|
|
116
|
-
npm publish --access public || {
|
|
117
|
-
if npm view "$PACKAGE_NAME@${{ steps.package-version.outputs.version }}" version --registry=https://registry.npmjs.org >/dev/null 2>&1; then
|
|
118
|
-
echo "Version already exists, skipping publish"
|
|
119
|
-
exit 0
|
|
120
|
-
else
|
|
121
|
-
echo "Publish failed for unknown reason"
|
|
122
|
-
exit 1
|
|
123
|
-
fi
|
|
124
|
-
}
|
|
125
|
-
env:
|
|
126
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
127
|
-
continue-on-error: true
|
|
103
|
+
# Publish to GitHub Packages with scoped name
|
|
104
|
+
npm publish
|
|
128
105
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
run: |
|
|
134
|
-
PACKAGE_NAME="${{ steps.package-name.outputs.name }}"
|
|
135
|
-
SCOPE="${{ steps.package-name.outputs.scope }}"
|
|
136
|
-
npm config set registry https://npm.pkg.github.com
|
|
137
|
-
npm config set ${SCOPE}:registry https://npm.pkg.github.com
|
|
138
|
-
npm config set //npm.pkg.github.com/:_authToken ${{ secrets.GITHUB_TOKEN }}
|
|
139
|
-
npm publish || {
|
|
140
|
-
if npm view "$PACKAGE_NAME@${{ steps.package-version.outputs.version }}" version --registry=https://npm.pkg.github.com >/dev/null 2>&1; then
|
|
141
|
-
echo "Version already exists, skipping publish"
|
|
142
|
-
exit 0
|
|
143
|
-
else
|
|
144
|
-
echo "Publish failed for unknown reason"
|
|
145
|
-
exit 1
|
|
146
|
-
fi
|
|
147
|
-
}
|
|
106
|
+
# Restore original package.json
|
|
107
|
+
mv package.json.backup package.json
|
|
108
|
+
|
|
109
|
+
echo "Successfully published $OWNER/$PACKAGE_NAME@$VERSION to GitHub Packages"
|
|
148
110
|
env:
|
|
149
111
|
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
150
|
-
continue-on-error: true
|
|
151
112
|
|
|
152
|
-
- name:
|
|
153
|
-
|
|
113
|
+
- name: Create Git tag
|
|
114
|
+
if: steps.check-version.outputs.exists == 'false'
|
|
154
115
|
run: |
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
NPMJS_SKIPPED=false
|
|
158
|
-
GITHUB_SKIPPED=false
|
|
159
|
-
|
|
160
|
-
# Check if npmjs was published in this run
|
|
161
|
-
if [ "${{ steps.check-npmjs.outputs.exists }}" == "false" ] && [ "${{ steps.publish-npmjs.outcome }}" == "success" ]; then
|
|
162
|
-
NPMJS_PUBLISHED=true
|
|
163
|
-
elif [ "${{ steps.check-npmjs.outputs.exists }}" == "true" ]; then
|
|
164
|
-
NPMJS_SKIPPED=true
|
|
165
|
-
fi
|
|
116
|
+
VERSION=${{ steps.package-info.outputs.version }}
|
|
117
|
+
PACKAGE_NAME="${{ steps.package-info.outputs.name }}"
|
|
166
118
|
|
|
167
|
-
|
|
168
|
-
if [ "${{ steps.check-github.outputs.exists }}" == "false" ] && [ "${{ steps.publish-github.outcome }}" == "success" ]; then
|
|
169
|
-
GITHUB_PUBLISHED=true
|
|
170
|
-
elif [ "${{ steps.check-github.outputs.exists }}" == "true" ]; then
|
|
171
|
-
GITHUB_SKIPPED=true
|
|
172
|
-
fi
|
|
119
|
+
TAG_NAME="v$VERSION"
|
|
173
120
|
|
|
174
|
-
#
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
if [ "$NPMJS_PUBLISHED" == "true" ] || [ "$GITHUB_PUBLISHED" == "true" ]; then
|
|
178
|
-
echo "should_create=true" >> $GITHUB_OUTPUT
|
|
179
|
-
echo "Should create release: npmjs_published=$NPMJS_PUBLISHED, github_published=$GITHUB_PUBLISHED, npmjs_skipped=$NPMJS_SKIPPED, github_skipped=$GITHUB_SKIPPED"
|
|
121
|
+
# Check if tag already exists
|
|
122
|
+
if git tag -l | grep -q "^$TAG_NAME$"; then
|
|
123
|
+
echo "Tag $TAG_NAME already exists, skipping tag creation"
|
|
180
124
|
else
|
|
181
|
-
echo "
|
|
182
|
-
|
|
125
|
+
echo "Creating tag $TAG_NAME"
|
|
126
|
+
git config --local user.email "action@github.com"
|
|
127
|
+
git config --local user.name "GitHub Action"
|
|
128
|
+
git tag "$TAG_NAME"
|
|
129
|
+
git push origin "$TAG_NAME"
|
|
130
|
+
echo "Tag $TAG_NAME created and pushed"
|
|
183
131
|
fi
|
|
184
132
|
|
|
185
133
|
- name: Create GitHub Release
|
|
186
|
-
if: steps.
|
|
134
|
+
if: steps.check-version.outputs.exists == 'false'
|
|
187
135
|
uses: softprops/action-gh-release@v2
|
|
188
136
|
with:
|
|
189
|
-
tag_name: v${{ steps.package-
|
|
190
|
-
name: v${{ steps.package-
|
|
191
|
-
prerelease: ${{ contains(steps.package-version.outputs.version, 'beta') || contains(steps.package-version.outputs.version, 'alpha') || contains(steps.package-version.outputs.version, 'rc') }}
|
|
137
|
+
tag_name: v${{ steps.package-info.outputs.version }}
|
|
138
|
+
name: Release v${{ steps.package-info.outputs.version }}
|
|
192
139
|
body: |
|
|
193
|
-
## ${{ steps.package-
|
|
140
|
+
## ${{ steps.package-info.outputs.name }}@v${{ steps.package-info.outputs.version }}
|
|
194
141
|
|
|
195
|
-
**Published to
|
|
196
|
-
|
|
197
|
-
- **npmjs.com**: https://www.npmjs.com/package/${{ steps.package-name.outputs.name }}
|
|
198
|
-
- **GitHub Packages**: https://github.com/${{ github.repository }}/packages
|
|
199
|
-
|
|
200
|
-
*Note: If a registry already had this version, it was skipped. Only missing registries were published.*
|
|
142
|
+
**Published to GitHub Packages**
|
|
201
143
|
|
|
202
144
|
### Installation
|
|
203
145
|
|
|
204
|
-
**From npmjs (default):**
|
|
205
|
-
|
|
206
146
|
```bash
|
|
207
|
-
npm install
|
|
208
|
-
|
|
209
|
-
# or
|
|
210
|
-
|
|
211
|
-
pnpm install -g ${{ steps.package-name.outputs.name }}
|
|
147
|
+
npm install @${{ github.repository_owner }}/${{ steps.package-info.outputs.name }} --registry=https://npm.pkg.github.com
|
|
212
148
|
```
|
|
213
149
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
First, create or update your `.npmrc` file:
|
|
150
|
+
Or add to your `.npmrc`:
|
|
217
151
|
|
|
218
|
-
```
|
|
219
|
-
|
|
152
|
+
```
|
|
153
|
+
@${{ github.repository_owner }}:registry=https://npm.pkg.github.com
|
|
220
154
|
//npm.pkg.github.com/:_authToken=YOUR_GITHUB_TOKEN
|
|
221
155
|
```
|
|
222
156
|
|
|
223
157
|
Then install:
|
|
224
158
|
|
|
225
159
|
```bash
|
|
226
|
-
npm install
|
|
227
|
-
|
|
228
|
-
# or
|
|
229
|
-
|
|
230
|
-
pnpm install -g ${{ steps.package-name.outputs.name }}
|
|
160
|
+
npm install @${{ github.repository_owner }}/${{ steps.package-info.outputs.name }}
|
|
231
161
|
```
|
|
232
162
|
|
|
233
|
-
###
|
|
163
|
+
### What's New
|
|
164
|
+
|
|
165
|
+
- Automated release from CI/CD pipeline
|
|
166
|
+
- All tests passed ✅
|
|
167
|
+
- Extension built successfully ✅
|
|
234
168
|
|
|
235
|
-
```bash
|
|
236
|
-
intern-corner-scheduler
|
|
237
|
-
```
|
|
238
|
-
generate_release_notes: true
|
|
239
169
|
draft: false
|
|
170
|
+
prerelease: false
|
|
240
171
|
env:
|
|
241
172
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
242
173
|
|
|
243
|
-
- name: Publish
|
|
174
|
+
- name: Publish Summary
|
|
244
175
|
if: always()
|
|
245
176
|
run: |
|
|
246
|
-
echo "## Publish Summary"
|
|
247
|
-
echo "
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
echo "
|
|
177
|
+
echo "## 📦 Publish Summary"
|
|
178
|
+
echo "Package: ${{ steps.package-info.outputs.name }}@${{ steps.package-info.outputs.version }}"
|
|
179
|
+
|
|
180
|
+
if [ "${{ steps.check-version.outputs.exists }}" == "true" ]; then
|
|
181
|
+
echo "✅ Version already exists - skipped publishing"
|
|
182
|
+
elif [ "${{ steps.check-version.outputs.exists }}" == "false" ]; then
|
|
183
|
+
echo "✅ Successfully published to GitHub Packages"
|
|
184
|
+
echo "🏷️ Created tag: v${{ steps.package-info.outputs.version }}"
|
|
185
|
+
echo "📝 Created release: v${{ steps.package-info.outputs.version }}"
|
|
254
186
|
else
|
|
255
|
-
echo "
|
|
187
|
+
echo "❌ Publish status unknown"
|
|
256
188
|
fi
|
|
189
|
+
|
|
257
190
|
echo ""
|
|
258
|
-
echo "###
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
echo "Skipped - version already exists"
|
|
263
|
-
elif [ "${{ steps.publish-github.outcome }}" == "success" ]; then
|
|
264
|
-
echo "Published successfully"
|
|
265
|
-
elif [ "${{ steps.publish-github.outcome }}" == "failure" ]; then
|
|
266
|
-
echo "Failed to publish"
|
|
267
|
-
else
|
|
268
|
-
echo "Skipped - not attempted"
|
|
269
|
-
fi
|
|
191
|
+
echo "### 🔗 Links"
|
|
192
|
+
echo "- **GitHub Packages**: https://github.com/${{ github.repository }}/packages"
|
|
193
|
+
echo "- **Install Command**: npm install @${{ github.repository_owner }}/${{ steps.package-info.outputs.name }} --registry=https://npm.pkg.github.com"
|
|
194
|
+
echo "- **Release**: https://github.com/${{ github.repository }}/releases/tag/v${{ steps.package-info.outputs.version }}"
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://www.raycast.com/schemas/extension.json",
|
|
3
3
|
"name": "raycast-rsync-extension",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.3",
|
|
5
5
|
"title": "Rsync File Transfer",
|
|
6
6
|
"description": "Transfer files between local and remote servers using rsync with SSH config integration",
|
|
7
7
|
"icon": "icon.png",
|
|
@@ -83,11 +83,10 @@
|
|
|
83
83
|
"dev": "ray develop",
|
|
84
84
|
"fix-lint": "ray lint --fix",
|
|
85
85
|
"lint": "ray lint",
|
|
86
|
-
"publish": "npx @raycast/api@latest publish",
|
|
87
86
|
"test": "vitest --run",
|
|
88
87
|
"test:watch": "vitest",
|
|
89
88
|
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,css,md}\"",
|
|
90
89
|
"format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,json,css,md}\"",
|
|
91
|
-
"publish:
|
|
90
|
+
"publish:npmjs": "npm publish --access public"
|
|
92
91
|
}
|
|
93
92
|
}
|