Skip to content

Commit 1b27546

Browse files
committed
fix: wait for release assets before signing
1 parent 100b75f commit 1b27546

File tree

3 files changed

+335
-29
lines changed

3 files changed

+335
-29
lines changed

.github/workflows/release.yml

Lines changed: 113 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,19 @@ jobs:
1414
include:
1515
- platform: 'macos-latest'
1616
args: '--target aarch64-apple-darwin'
17+
artifact_name: 'LitePost_aarch64.app.tar.gz'
1718
- platform: 'macos-latest'
1819
args: '--target x86_64-apple-darwin'
20+
artifact_name: 'LitePost_x64.app.tar.gz'
1921
- platform: 'ubuntu-22.04'
2022
args: ''
23+
artifact_name: 'litepost_0.1.0_amd64.AppImage'
2124
- platform: 'windows-latest'
2225
args: ''
26+
artifact_name: 'LitePost_0.1.0_x64-setup.exe'
2327
runs-on: ${{ matrix.platform }}
2428
outputs:
25-
release_url: ${{ steps.build-app.outputs.release_url }}
29+
upload_url: ${{ steps.create_release.outputs.upload_url }}
2630
steps:
2731
- name: Checkout
2832
uses: actions/checkout@v4
@@ -52,14 +56,26 @@ jobs:
5256
- name: Install frontend dependencies
5357
run: pnpm install
5458

59+
- name: Create Release
60+
id: create_release
61+
if: matrix.platform == 'ubuntu-22.04'
62+
uses: actions/create-release@v1
63+
env:
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
with:
66+
tag_name: ${{ github.ref_name }}
67+
release_name: 'LitePost ${{ github.ref_name }}'
68+
body: 'See the assets to download this version and install.'
69+
draft: true
70+
prerelease: false
71+
5572
- name: Build the app
56-
id: build-app
5773
uses: tauri-apps/tauri-action@v0
5874
env:
5975
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6076
with:
6177
tagName: ${{ github.ref_name }}
62-
releaseName: 'LitePost v${{ github.ref_name }}'
78+
releaseName: 'LitePost ${{ github.ref_name }}'
6379
releaseBody: 'See the assets to download this version and install.'
6480
releaseDraft: true
6581
prerelease: false
@@ -86,10 +102,83 @@ jobs:
86102
- name: Install Tauri CLI
87103
run: pnpm add -D @tauri-apps/cli
88104

89-
- name: Download all artifacts
90-
uses: actions/download-artifact@v3
105+
- name: Wait for release assets
106+
uses: actions/github-script@v7
107+
with:
108+
script: |
109+
const artifacts = [
110+
'LitePost_aarch64.app.tar.gz',
111+
'LitePost_x64.app.tar.gz',
112+
'litepost_0.1.0_amd64.AppImage',
113+
'LitePost_0.1.0_x64-setup.exe'
114+
];
115+
116+
const tag = context.ref.replace('refs/tags/', '');
117+
const owner = context.repo.owner;
118+
const repo = context.repo.repo;
119+
120+
let attempts = 0;
121+
const maxAttempts = 30;
122+
123+
while (attempts < maxAttempts) {
124+
const release = await github.rest.repos.getReleaseByTag({
125+
owner,
126+
repo,
127+
tag
128+
});
129+
130+
const assets = release.data.assets.map(asset => asset.name);
131+
const missingAssets = artifacts.filter(artifact => !assets.includes(artifact));
132+
133+
if (missingAssets.length === 0) {
134+
console.log('All assets found!');
135+
break;
136+
}
137+
138+
console.log(`Waiting for assets: ${missingAssets.join(', ')}`);
139+
attempts++;
140+
141+
if (attempts === maxAttempts) {
142+
throw new Error('Timed out waiting for assets');
143+
}
144+
145+
await new Promise(resolve => setTimeout(resolve, 10000));
146+
}
147+
148+
- name: Download release assets
149+
uses: actions/github-script@v7
91150
with:
92-
path: artifacts
151+
script: |
152+
const artifacts = [
153+
'LitePost_aarch64.app.tar.gz',
154+
'LitePost_x64.app.tar.gz',
155+
'litepost_0.1.0_amd64.AppImage',
156+
'LitePost_0.1.0_x64-setup.exe'
157+
];
158+
159+
const tag = context.ref.replace('refs/tags/', '');
160+
const owner = context.repo.owner;
161+
const repo = context.repo.repo;
162+
163+
const release = await github.rest.repos.getReleaseByTag({
164+
owner,
165+
repo,
166+
tag
167+
});
168+
169+
const fs = require('fs');
170+
const path = require('path');
171+
172+
if (!fs.existsSync('artifacts')) {
173+
fs.mkdirSync('artifacts');
174+
}
175+
176+
for (const asset of release.data.assets) {
177+
if (artifacts.includes(asset.name)) {
178+
const response = await github.request(asset.browser_download_url);
179+
fs.writeFileSync(path.join('artifacts', asset.name), Buffer.from(response.data));
180+
}
181+
}
93182
94183
- name: Generate signatures and updater JSON
95184
env:
@@ -99,28 +188,23 @@ jobs:
99188
run: |
100189
# Sign artifacts and collect signatures
101190
declare -A signatures
102-
for file in artifacts/build-*/; do
103-
if [ -f "$file" ]; then
104-
signature=$(pnpm tauri signer sign "$file")
105-
platform=$(basename "$file" | cut -d'-' -f2-)
106-
107-
case "$platform" in
108-
"macos-latest")
109-
if [[ "$file" == *"aarch64"* ]]; then
110-
signatures["darwin-aarch64"]="$signature"
111-
else
112-
signatures["darwin-x86_64"]="$signature"
113-
fi
114-
;;
115-
"ubuntu-22.04")
116-
signatures["linux-x86_64"]="$signature"
117-
;;
118-
"windows-latest")
119-
signatures["windows-x86_64"]="$signature"
120-
;;
121-
esac
122-
fi
123-
done
191+
192+
# Sign each artifact directly
193+
if [ -f "artifacts/LitePost_x64.app.tar.gz" ]; then
194+
signatures["darwin-x86_64"]=$(pnpm tauri signer sign "artifacts/LitePost_x64.app.tar.gz")
195+
fi
196+
197+
if [ -f "artifacts/LitePost_aarch64.app.tar.gz" ]; then
198+
signatures["darwin-aarch64"]=$(pnpm tauri signer sign "artifacts/LitePost_aarch64.app.tar.gz")
199+
fi
200+
201+
if [ -f "artifacts/litepost_0.1.0_amd64.AppImage" ]; then
202+
signatures["linux-x86_64"]=$(pnpm tauri signer sign "artifacts/litepost_0.1.0_amd64.AppImage")
203+
fi
204+
205+
if [ -f "artifacts/LitePost_0.1.0_x64-setup.exe" ]; then
206+
signatures["windows-x86_64"]=$(pnpm tauri signer sign "artifacts/LitePost_0.1.0_x64-setup.exe")
207+
fi
124208
125209
# Create latest.json with collected signatures
126210
echo '{
@@ -152,7 +236,7 @@ jobs:
152236
env:
153237
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
154238
with:
155-
upload_url: ${{ needs.build.outputs.release_url }}
239+
upload_url: ${{ needs.build.outputs.upload_url }}
156240
asset_path: ./latest.json
157241
asset_name: latest.json
158242
asset_content_type: application/json

TODO.md

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
Based on the codebase and comparing with Postman, here are some key features we could add to enhance the functionality:
2+
3+
1. **Request Features**:
4+
- **Authentication Support**
5+
- Basic Auth
6+
- Bearer Token
7+
- OAuth 2.0
8+
- API Key
9+
10+
- **Cookie Management**
11+
- Cookie jar
12+
- Session handling
13+
- Domain-specific cookies
14+
15+
2. **Response Handling**:
16+
- **Response Formatting**
17+
- JSON prettification with syntax highlighting
18+
- XML formatting
19+
- HTML preview
20+
- Image preview for image responses
21+
- PDF preview
22+
23+
- **Response Size and Time**
24+
- Show response size
25+
- Show request/response timing
26+
- Network timing breakdown
27+
28+
3. **Environment Management**:
29+
30+
4. **Collection Management**:
31+
32+
5. **Code Generation**:
33+
- Generate code snippets for different languages (curl, Python, JavaScript, etc.)
34+
- Copy as cURL command
35+
36+
6. **Testing Features**:
37+
38+
7. **WebSocket/GraphQL Support**:
39+
- WebSocket connection handling
40+
- GraphQL query builder
41+
- GraphQL schema exploration
42+
43+
8. **Advanced Features**:
44+
- **Proxy Configuration**
45+
- **SSL Certificate Verification**
46+
- **Request Chaining**
47+
- **Pre-request Scripts**
48+
- **Response Schemas**
49+
- **File Upload Support**
50+
51+
9. **Collaboration Features**:
52+
- **Team Workspaces**
53+
- **Request Sharing**
54+
- **Documentation**
55+
56+
Here's a basic implementation plan I would suggest:
57+
58+
1. First Priority (Core Features):
59+
60+
2. Second Priority (User Experience):
61+
- Response formatting and previews
62+
- Code generation
63+
- Basic authentication support
64+
65+
3. Third Priority (Advanced Features):
66+
- Collections
67+
- Testing
68+
- WebSocket/GraphQL support
69+
70+
Let me break down the core features we should prioritize first, without any code:
71+
72+
1. **Environment Variables & Management**
73+
- Create/edit/delete environments (e.g., "Development", "Production")
74+
- Variable substitution in requests (e.g., replace {{baseUrl}} with actual value)
75+
- Quick environment switching
76+
- Environment variable inheritance (global → environment-specific)
77+
78+
2. **Request/Response Improvements**
79+
- Response syntax highlighting for JSON/XML/HTML
80+
- Response size and timing metrics
81+
- Request timing breakdown (DNS, TLS, First byte, etc.)
82+
- Save responses as files
83+
- Copy response as JSON/raw
84+
85+
3. **Basic Authentication Support**
86+
- Basic Auth (username/password)
87+
- Bearer Token auth
88+
- API Key auth (as header or query param)
89+
- Cookie management
90+
91+
4. **Request Organization**
92+
- Save requests to collections
93+
- Organize collections in folders
94+
- Import/export collections
95+
- Search across requests
96+
97+
5. **Request Building Improvements**
98+
- Form data support
99+
- File upload support
100+
- Raw body input with syntax highlighting
101+
- Query parameter builder with validation
102+
- Better header management with common header suggestions
103+
104+
These features would provide a solid foundation similar to Postman's core functionality. Would you like me to elaborate on any of these areas?
105+
106+
Implemented Features:
107+
1. Authentication Support:
108+
- Basic Auth ✅
109+
- Bearer Token ✅
110+
- API Key ✅ (both header and query param)
111+
112+
2. Response Handling:
113+
- JSON prettification with syntax highlighting ✅
114+
- HTML preview ✅
115+
- Image preview ✅
116+
- Response size metrics ✅
117+
- Request/response timing ✅
118+
- Network timing breakdown ✅ (DNS, First byte, Download time)
119+
120+
3. Code Generation:
121+
- Generate code snippets ✅ (curl, Python, JavaScript, C#, Go, Ruby)
122+
- Copy as cURL command ✅
123+
124+
Still To Do:
125+
1. Authentication:
126+
- Basic Auth ✅
127+
- Bearer Token ✅
128+
- API Key ✅
129+
- OAuth 2.0 ❌
130+
131+
2. Cookie Management:
132+
- Basic cookie sending/receiving ✅
133+
- Persistent cookie jar ❌
134+
- Advanced session handling ❌
135+
- Domain/path-specific cookie rules ❌
136+
137+
3. Response Handling:
138+
- JSON prettification with syntax highlighting ✅
139+
- XML formatting ✅
140+
- HTML preview ✅
141+
- Image preview ✅
142+
- PDF preview ❌
143+
- Response size metrics ✅
144+
- Request/response timing ✅
145+
- Network timing breakdown ✅
146+
147+
4. Environment Management:
148+
- Create/edit/delete environments ✅
149+
- Variable substitution ✅
150+
- Environment switching ✅
151+
- Global/environment-specific variables ✅
152+
153+
5. Collection Management:
154+
- Save requests to collections ✅
155+
- Basic folder organization ✅
156+
- Import/export collections ✅
157+
- Postman format support ✅
158+
- Nested folders/hierarchical organization ❌
159+
- Collection variables ❌
160+
- Collection-level scripts ❌
161+
162+
6. Testing Features:
163+
- Basic test scripts ✅
164+
- Test assertions ✅
165+
- Status code ✅
166+
- JSON values ✅
167+
- Headers ✅
168+
- Response time ✅
169+
- Test runs with results ✅
170+
- Collection-level tests ❌
171+
- Data-driven tests ❌
172+
- Test reports and exports ❌
173+
174+
7. WebSocket/GraphQL Support:
175+
- WebSocket connections ❌
176+
- GraphQL query builder ❌
177+
- Schema exploration ❌
178+
179+
8. Advanced Features:
180+
- Proxy Configuration ❌
181+
- SSL Certificate Verification ❌
182+
- Request Chaining ❌
183+
- Pre-request Scripts ❌
184+
- Response Schemas ❌
185+
- File Upload Support ❌
186+
187+
9. Code Generation:
188+
- Generate code snippets ✅ (curl, Python, JavaScript, C#, Go, Ruby)
189+
- Copy as cURL command ✅
190+
191+
10. Collaboration Features:
192+
- Team Workspaces ❌
193+
- Request Sharing ❌
194+
- Documentation ❌
195+
196+
The most critical missing features that would significantly improve usability are:
197+
1. Nested Collection Organization - for better request organization
198+
2. Advanced Cookie Management - for better session handling across domains
199+
3. Collection-level Testing - for automated API testing workflows

0 commit comments

Comments
 (0)