Skip to content

Commit a458867

Browse files
committed
try: stabalize build creation
1 parent fa87ae8 commit a458867

File tree

4 files changed

+154
-9
lines changed

4 files changed

+154
-9
lines changed

.github/workflows/build-orchestrator.yml

Lines changed: 69 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ jobs:
121121
uses: ./.github/workflows/bump-version.yml
122122
with:
123123
version: ${{ needs.prepare.outputs.version }}
124+
# Always creates temp branch - will merge to main only if draft release succeeds
124125

125126
build-macos:
126127
needs: [prepare, bump-version]
@@ -134,7 +135,7 @@ jobs:
134135
platform: macos-latest
135136
build_variant: ${{ needs.prepare.outputs.build_variant }}
136137
custom_url: ${{ inputs.custom_url }}
137-
git_ref: ${{ needs.bump-version.outputs.version_tag || github.ref }}
138+
git_ref: ${{ needs.bump-version.outputs.branch_name || github.ref }}
138139

139140
build-windows:
140141
needs: [prepare, bump-version]
@@ -148,7 +149,7 @@ jobs:
148149
platform: windows-latest
149150
build_variant: ${{ needs.prepare.outputs.build_variant }}
150151
custom_url: ${{ inputs.custom_url }}
151-
git_ref: ${{ needs.bump-version.outputs.version_tag || github.ref }}
152+
git_ref: ${{ needs.bump-version.outputs.branch_name || github.ref }}
152153

153154
build-linux:
154155
needs: [prepare, bump-version]
@@ -162,7 +163,7 @@ jobs:
162163
platform: ubuntu-latest
163164
build_variant: ${{ needs.prepare.outputs.build_variant }}
164165
custom_url: ${{ inputs.custom_url }}
165-
git_ref: ${{ needs.bump-version.outputs.version_tag || github.ref }}
166+
git_ref: ${{ needs.bump-version.outputs.branch_name || github.ref }}
166167
checkout_branch: '' # Use git_ref instead - will fall back to current branch
167168

168169
build-setapp:
@@ -175,7 +176,7 @@ jobs:
175176
uses: ./.github/workflows/build-setapp.yml
176177
secrets: inherit
177178
with:
178-
git_ref: ${{ needs.bump-version.outputs.version_tag || github.ref }} # Use current branch instead of hardcoding
179+
git_ref: ${{ needs.bump-version.outputs.branch_name || github.ref }}
179180

180181
create-draft:
181182
needs: [prepare, build-macos, build-windows, build-linux]
@@ -192,8 +193,65 @@ jobs:
192193
version_tag: ${{ needs.prepare.outputs.version_tag }}
193194
artifact_names: 'macos-build,windows-build,linux-build'
194195

196+
merge-to-main:
197+
needs: [prepare, bump-version, create-draft]
198+
if: |
199+
always() &&
200+
needs.create-draft.result == 'success' &&
201+
needs.bump-version.result == 'success'
202+
runs-on: ubuntu-latest
203+
204+
steps:
205+
- name: Checkout repository
206+
uses: actions/checkout@v4
207+
with:
208+
ref: ${{ github.ref_name }}
209+
fetch-depth: 0
210+
211+
- name: Merge temporary branch to main
212+
run: |
213+
TEMP_BRANCH="${{ needs.bump-version.outputs.branch_name }}"
214+
TARGET_BRANCH="${{ github.ref_name }}"
215+
216+
echo "📦 Merging $TEMP_BRANCH → $TARGET_BRANCH"
217+
218+
git config user.name "github-actions[bot]"
219+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
220+
221+
# Fetch the temp branch
222+
git fetch origin "$TEMP_BRANCH"
223+
224+
# Merge temp branch (fast-forward, should be clean)
225+
git merge --ff-only "origin/$TEMP_BRANCH" -m "Merge version bump v${{ needs.prepare.outputs.version }}
226+
227+
Draft release created successfully.
228+
Temporary branch: $TEMP_BRANCH
229+
230+
🤖 Generated by GitHub Actions
231+
Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
232+
233+
# Push to main
234+
git push origin "HEAD:$TARGET_BRANCH"
235+
236+
echo "✅ Merged $TEMP_BRANCH → $TARGET_BRANCH"
237+
238+
- name: Delete temporary branch
239+
run: |
240+
TEMP_BRANCH="${{ needs.bump-version.outputs.branch_name }}"
241+
echo "🗑️ Deleting temporary branch: $TEMP_BRANCH"
242+
git push origin --delete "$TEMP_BRANCH"
243+
echo "✅ Deleted: $TEMP_BRANCH"
244+
245+
- name: Summary
246+
run: |
247+
echo "### ✅ Version Merged to Main" >> $GITHUB_STEP_SUMMARY
248+
echo "" >> $GITHUB_STEP_SUMMARY
249+
echo "- **Version**: v${{ needs.prepare.outputs.version }}" >> $GITHUB_STEP_SUMMARY
250+
echo "- **Target Branch**: ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
251+
echo "- **Temporary Branch**: ${{ needs.bump-version.outputs.branch_name }} (deleted)" >> $GITHUB_STEP_SUMMARY
252+
195253
summary:
196-
needs: [prepare, build-macos, build-windows, build-linux, build-setapp, create-draft]
254+
needs: [prepare, build-macos, build-windows, build-linux, build-setapp, create-draft, merge-to-main]
197255
if: always()
198256
runs-on: ubuntu-latest
199257
steps:
@@ -217,6 +275,12 @@ jobs:
217275
echo "" >> $GITHUB_STEP_SUMMARY
218276
if [ "${{ needs.create-draft.result }}" == "success" ]; then
219277
echo "**🎉 Draft Release**: [View Releases](https://github.com/${{ github.repository }}/releases)" >> $GITHUB_STEP_SUMMARY
278+
echo "**✅ Version**: Merged to ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
220279
else
221280
echo "**📥 Artifacts**: [Download from Run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})" >> $GITHUB_STEP_SUMMARY
281+
if [ "${{ needs.bump-version.result }}" == "success" ]; then
282+
echo "**⚠️ Temporary Branch**: \`${{ needs.bump-version.outputs.branch_name }}\` (not merged to main)" >> $GITHUB_STEP_SUMMARY
283+
echo "" >> $GITHUB_STEP_SUMMARY
284+
echo "_Temp branch will remain until manually cleaned up_" >> $GITHUB_STEP_SUMMARY
285+
fi
222286
fi

.github/workflows/build-setapp.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ jobs:
3131
with:
3232
ref: ${{ inputs.git_ref || github.ref }} # Fall back to current branch if not specified
3333

34+
- name: Setup Python for node-gyp
35+
uses: actions/setup-python@v5
36+
with:
37+
python-version: '3.12'
38+
39+
- name: Install setuptools for node-gyp
40+
run: |
41+
python -m pip install --upgrade pip
42+
python -m pip install setuptools
43+
3444
- name: Setup Node.js
3545
uses: actions/setup-node@v4
3646
with:
@@ -55,12 +65,13 @@ jobs:
5565
run: bash .erb/scripts/setapp-post-process.sh
5666

5767
- name: Upload artifact
68+
if: always()
5869
uses: actions/upload-artifact@v4
5970
with:
6071
name: setapp-build
6172
path: release/build-setapp/Requestly-Setapp-*.zip
6273
retention-days: 30
63-
if-no-files-found: error
74+
if-no-files-found: warn
6475

6576
- name: Summary
6677
run: |

.github/workflows/bump-version.yml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,18 @@ on:
1717
description: 'Git tag created'
1818
value: ${{ jobs.bump.outputs.tag }}
1919

20+
branch_name:
21+
description: 'Temporary branch name where version was committed'
22+
value: ${{ jobs.bump.outputs.branch_name }}
23+
2024
jobs:
2125
bump:
2226
runs-on: ubuntu-latest
2327

2428
outputs:
2529
version: ${{ steps.bump.outputs.version }}
2630
tag: ${{ steps.bump.outputs.tag }}
31+
branch_name: ${{ steps.commit.outputs.branch_name }}
2732

2833
steps:
2934
- name: Checkout repository
@@ -44,28 +49,44 @@ jobs:
4449
echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT
4550
echo "tag=v${{ inputs.version }}" >> $GITHUB_OUTPUT
4651
47-
- name: Commit and push changes
52+
- name: Create temporary branch and commit
53+
id: commit
4854
run: |
55+
# Always create temporary branch - will merge to main only if draft release succeeds
56+
TEMP_BRANCH="tmp-version-${{ inputs.version }}"
57+
echo "📦 Creating temporary branch: $TEMP_BRANCH"
58+
4959
git config user.name "github-actions[bot]"
5060
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
61+
git checkout -b "$TEMP_BRANCH"
5162
git add package.json release/app/package.json
5263
git commit -m "chore: bump version to v${{ inputs.version }}
5364
65+
⚠️ TEMPORARY BRANCH - builds will use this
66+
Will merge to main only if draft release succeeds.
67+
5468
🤖 Generated by GitHub Actions
5569
Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
5670
5771
git tag -a "v${{ inputs.version }}" \
5872
-m "Release v${{ inputs.version }}" \
73+
-m "Branch: $TEMP_BRANCH (temporary)" \
5974
-m "Workflow: ${{ github.workflow }}" \
6075
-m "Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
6176
62-
git push origin HEAD:${{ github.ref_name }}
77+
git push origin "$TEMP_BRANCH"
6378
git push origin "v${{ inputs.version }}"
6479
80+
echo "branch_name=$TEMP_BRANCH" >> $GITHUB_OUTPUT
81+
echo "✅ Temporary branch created: $TEMP_BRANCH"
82+
6583
- name: Summary
6684
run: |
67-
echo "### ✅ Version Bumped" >> $GITHUB_STEP_SUMMARY
85+
echo "### ✅ Version Bumped (Temporary Branch)" >> $GITHUB_STEP_SUMMARY
6886
echo "" >> $GITHUB_STEP_SUMMARY
6987
echo "- **Version**: v${{ inputs.version }}" >> $GITHUB_STEP_SUMMARY
88+
echo "- **Branch**: ${{ steps.commit.outputs.branch_name }}" >> $GITHUB_STEP_SUMMARY
7089
echo "- **Commit**: $(git rev-parse HEAD)" >> $GITHUB_STEP_SUMMARY
7190
echo "- **Tag**: v${{ inputs.version }}" >> $GITHUB_STEP_SUMMARY
91+
echo "" >> $GITHUB_STEP_SUMMARY
92+
echo "⚠️ **Note**: Temporary branch - will merge to main if draft release succeeds" >> $GITHUB_STEP_SUMMARY

.github/workflows/release_desktop_app.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,18 @@ jobs:
7979
with:
8080
ref: ${{ inputs.checkout_branch || inputs.git_ref || github.ref }}
8181

82+
- name: Setup Python for node-gyp (macOS only)
83+
if: ${{ (inputs.platform || github.event.inputs.build_type) == 'macos-latest' }}
84+
uses: actions/setup-python@v5
85+
with:
86+
python-version: '3.12'
87+
88+
- name: Install setuptools for node-gyp (macOS only)
89+
if: ${{ (inputs.platform || github.event.inputs.build_type) == 'macos-latest' }}
90+
run: |
91+
python -m pip install --upgrade pip
92+
python -m pip install setuptools
93+
8294
- name: Install Node.js, NPM and Yarn
8395
uses: actions/setup-node@v4
8496
with:
@@ -102,6 +114,43 @@ jobs:
102114
APPLE_ID: ${{ secrets.APPLE_ID }}
103115
APPLE_ID_PASS: ${{ secrets.APPLE_ID_PASS }}
104116

117+
- name: List build outputs
118+
if: always()
119+
run: |
120+
echo "Build outputs:"
121+
ls -lh release/build/ || echo "No build directory found"
122+
123+
- name: Upload macOS artifacts
124+
if: always() && (inputs.platform || github.event.inputs.build_type) == 'macos-latest'
125+
uses: actions/upload-artifact@v4
126+
with:
127+
name: macos-build
128+
path: |
129+
release/build/*.dmg
130+
release/build/*.zip
131+
retention-days: 30
132+
if-no-files-found: warn
133+
134+
- name: Upload Windows artifacts
135+
if: always() && (inputs.platform || github.event.inputs.build_type) == 'windows-latest'
136+
uses: actions/upload-artifact@v4
137+
with:
138+
name: windows-build
139+
path: |
140+
release/build/*.exe
141+
retention-days: 30
142+
if-no-files-found: warn
143+
144+
- name: Upload Linux artifacts
145+
if: always() && (inputs.platform || github.event.inputs.build_type) == 'ubuntu-latest'
146+
uses: actions/upload-artifact@v4
147+
with:
148+
name: linux-build
149+
path: |
150+
release/build/*.AppImage
151+
retention-days: 30
152+
if-no-files-found: warn
153+
105154
- name: Set artifact output
106155
id: output
107156
run: |

0 commit comments

Comments
 (0)