Skip to content

Commit ae99017

Browse files
committed
build: remove dmg generation from releases
1 parent f135c66 commit ae99017

File tree

4 files changed

+212
-5
lines changed

4 files changed

+212
-5
lines changed

.github/workflows/tauri-build-dev.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,110 @@ jobs:
326326
env:
327327
GITHUB_TOKEN: ${{ github.token }}
328328

329+
copyMacAppWithVersion:
330+
name: Copy Mac .app Files With Version
331+
needs: [ create-release, build-tauri, build-linux-bins ]
332+
runs-on: ubuntu-22.04
333+
permissions:
334+
contents: write
335+
steps:
336+
- uses: actions/checkout@v4
337+
338+
# Recompute or ensure we have PACKAGE_VERSION and GIT_TAG_NAME in the env
339+
- name: get version
340+
run: |
341+
echo "PACKAGE_VERSION=$(node -p \"require('./package.json').version\")" >> $GITHUB_ENV
342+
echo "GIT_TAG_NAME=prod-app-v$(node -p \"require('./package.json').version\")" >> $GITHUB_ENV
343+
344+
#
345+
# 1) Download the x64 .app.tar.gz from the existing draft release
346+
#
347+
- name: Download x64 Mac asset
348+
id: download_x64
349+
uses: actions/github-script@v7
350+
with:
351+
script: |
352+
const fs = require("fs");
353+
const { data: release } = await github.rest.repos.getRelease({
354+
owner: context.repo.owner,
355+
repo: context.repo.repo,
356+
release_id: parseInt("${{ needs.create-release.outputs.release_id }}", 10)
357+
});
358+
const asset = release.assets.find(a => a.name === "Phoenix.Code.Experimental.Build_x64.app.tar.gz");
359+
if (!asset) {
360+
core.setFailed("Could not find 'Phoenix.Code.Experimental.Build_x64.app.tar.gz' in draft release assets.");
361+
return;
362+
}
363+
// Download the asset
364+
const download = await github.rest.repos.getReleaseAsset({
365+
owner: context.repo.owner,
366+
repo: context.repo.repo,
367+
asset_id: asset.id,
368+
headers: {
369+
accept: "application/octet-stream"
370+
}
371+
});
372+
fs.writeFileSync("Phoenix.Code.Experimental.Build_x64.app.tar.gz", Buffer.from(download.data));
373+
374+
#
375+
# 2) Download the aarch64 .app.tar.gz from the existing draft release
376+
#
377+
- name: Download aarch64 Mac asset
378+
id: download_aarch64
379+
uses: actions/github-script@v7
380+
with:
381+
script: |
382+
const fs = require("fs");
383+
const { data: release } = await github.rest.repos.getRelease({
384+
owner: context.repo.owner,
385+
repo: context.repo.repo,
386+
release_id: parseInt("${{ needs.create-release.outputs.release_id }}", 10)
387+
});
388+
const asset = release.assets.find(a => a.name === "Phoenix.Code.Experimental.Build_aarch64.app.tar.gz");
389+
if (!asset) {
390+
core.setFailed("Could not find 'Phoenix.Code.Experimental.Build_aarch64.app.tar.gz' in draft release assets.");
391+
return;
392+
}
393+
// Download the asset
394+
const download = await github.rest.repos.getReleaseAsset({
395+
owner: context.repo.owner,
396+
repo: context.repo.repo,
397+
asset_id: asset.id,
398+
headers: {
399+
accept: "application/octet-stream"
400+
}
401+
});
402+
fs.writeFileSync("Phoenix.Code.Experimental.Build_aarch64.app.tar.gz", Buffer.from(download.data));
403+
404+
#
405+
# 3) Rename each asset with the version appended
406+
#
407+
- name: Rename Mac assets to include version
408+
run: |
409+
echo "Renaming x64 Mac app..."
410+
mv Phoenix.Code.Experimental.Build_x64.app.tar.gz "Phoenix.Code.Experimental.Build_x64_${PACKAGE_VERSION}_intel.app.tar.gz"
411+
412+
echo "Renaming aarch64 Mac app..."
413+
mv Phoenix.Code.Experimental.Build_aarch64.app.tar.gz "Phoenix.Code.Experimental.Build_aarch64_${PACKAGE_VERSION}_M1.app.tar.gz"
414+
415+
echo "Final check of renamed files:"
416+
ls -lh
417+
418+
#
419+
# 4) Re-upload them to the draft release with new filenames. This is needed for download from web workflows
420+
#
421+
- name: Upload renamed Mac app tarballs to draft release
422+
uses: softprops/action-gh-release@v2
423+
with:
424+
release_id: ${{ needs.create-release.outputs.release_id }}
425+
draft: true
426+
tag_name: ${{ env.GIT_TAG_NAME }}
427+
files: |
428+
Phoenix.Code.Experimental.Build_x64_${{ env.PACKAGE_VERSION }}_intel.app.tar.gz
429+
Phoenix.Code.Experimental.Build_aarch64_${{ env.PACKAGE_VERSION }}_M1.app.tar.gz
430+
env:
431+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
432+
329433
publish-release:
330434
permissions:
331435
contents: write

.github/workflows/tauri-build-prod.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,110 @@ jobs:
372372
env:
373373
GITHUB_TOKEN: ${{ github.token }}
374374

375+
copyMacAppWithVersion:
376+
name: Copy Mac .app Files With Version
377+
needs: [ create-release, build-tauri, build-linux-bins ]
378+
runs-on: ubuntu-22.04
379+
permissions:
380+
contents: write
381+
steps:
382+
- uses: actions/checkout@v4
383+
384+
# Recompute or ensure we have PACKAGE_VERSION and GIT_TAG_NAME in the env
385+
- name: get version
386+
run: |
387+
echo "PACKAGE_VERSION=$(node -p \"require('./package.json').version\")" >> $GITHUB_ENV
388+
echo "GIT_TAG_NAME=prod-app-v$(node -p \"require('./package.json').version\")" >> $GITHUB_ENV
389+
390+
#
391+
# 1) Download the x64 .app.tar.gz from the existing draft release
392+
#
393+
- name: Download x64 Mac asset
394+
id: download_x64
395+
uses: actions/github-script@v7
396+
with:
397+
script: |
398+
const fs = require("fs");
399+
const { data: release } = await github.rest.repos.getRelease({
400+
owner: context.repo.owner,
401+
repo: context.repo.repo,
402+
release_id: parseInt("${{ needs.create-release.outputs.release_id }}", 10)
403+
});
404+
const asset = release.assets.find(a => a.name === "Phoenix.Code_x64.app.tar.gz");
405+
if (!asset) {
406+
core.setFailed("Could not find 'Phoenix.Code_x64.app.tar.gz' in draft release assets.");
407+
return;
408+
}
409+
// Download the asset
410+
const download = await github.rest.repos.getReleaseAsset({
411+
owner: context.repo.owner,
412+
repo: context.repo.repo,
413+
asset_id: asset.id,
414+
headers: {
415+
accept: "application/octet-stream"
416+
}
417+
});
418+
fs.writeFileSync("Phoenix.Code_x64.app.tar.gz", Buffer.from(download.data));
419+
420+
#
421+
# 2) Download the aarch64 .app.tar.gz from the existing draft release
422+
#
423+
- name: Download aarch64 Mac asset
424+
id: download_aarch64
425+
uses: actions/github-script@v7
426+
with:
427+
script: |
428+
const fs = require("fs");
429+
const { data: release } = await github.rest.repos.getRelease({
430+
owner: context.repo.owner,
431+
repo: context.repo.repo,
432+
release_id: parseInt("${{ needs.create-release.outputs.release_id }}", 10)
433+
});
434+
const asset = release.assets.find(a => a.name === "Phoenix.Code_aarch64.app.tar.gz");
435+
if (!asset) {
436+
core.setFailed("Could not find 'Phoenix.Code_aarch64.app.tar.gz' in draft release assets.");
437+
return;
438+
}
439+
// Download the asset
440+
const download = await github.rest.repos.getReleaseAsset({
441+
owner: context.repo.owner,
442+
repo: context.repo.repo,
443+
asset_id: asset.id,
444+
headers: {
445+
accept: "application/octet-stream"
446+
}
447+
});
448+
fs.writeFileSync("Phoenix.Code_aarch64.app.tar.gz", Buffer.from(download.data));
449+
450+
#
451+
# 3) Rename each asset with the version appended
452+
#
453+
- name: Rename Mac assets to include version
454+
run: |
455+
echo "Renaming x64 Mac app..."
456+
mv Phoenix.Code_x64.app.tar.gz "Phoenix.Code_x64_${PACKAGE_VERSION}_intel.app.tar.gz"
457+
458+
echo "Renaming aarch64 Mac app..."
459+
mv Phoenix.Code_aarch64.app.tar.gz "Phoenix.Code_aarch64_${PACKAGE_VERSION}_M1.app.tar.gz"
460+
461+
echo "Final check of renamed files:"
462+
ls -lh
463+
464+
#
465+
# 4) Re-upload them to the draft release with new filenames. This is needed for download from web workflows
466+
#
467+
- name: Upload renamed Mac app tarballs to draft release
468+
uses: softprops/action-gh-release@v2
469+
with:
470+
release_id: ${{ needs.create-release.outputs.release_id }}
471+
draft: true
472+
tag_name: ${{ env.GIT_TAG_NAME }}
473+
files: |
474+
Phoenix.Code_x64_${{ env.PACKAGE_VERSION }}_intel.app.tar.gz
475+
Phoenix.Code_aarch64_${{ env.PACKAGE_VERSION }}_M1.app.tar.gz
476+
env:
477+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
478+
375479
publish-release:
376480
permissions:
377481
contents: write

.github/workflows/updateNotification.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ async function _getLatestJson(releaseAssets) {
8383

8484
// "Phoenix.Code.Experimental.Build_3.4.2_x64-setup.exe"
8585
const WINDOWS_X64_NAME_SUFFIX = "_x64-setup.exe";
86-
// "Phoenix.Code.Experimental.Build_3.4.2_x64.dmg"
87-
const MAC_INTEL_NAME_SUFFIX = "_x64.dmg";
88-
// "Phoenix.Code.Experimental.Build_3.4.2_aarch64.dmg"
89-
const MAC_M1_NAME_SUFFIX = "_aarch64.dmg";
86+
// "Phoenix.Code.Experimental.Build_3.4.2_intel.app.tar.gz"
87+
const MAC_INTEL_NAME_SUFFIX = "_intel.app.tar.gz";
88+
// "Phoenix.Code.Experimental.Build_3.4.2_M1.app.tar.gz"
89+
const MAC_M1_NAME_SUFFIX = "_M1.app.tar.gz";
9090
function _getDownloadURLByNameSuffix(releaseAssets, suffix) {
9191
for(let releaseAsset of releaseAssets) {
9292
if(releaseAsset.name.endsWith(suffix)){

src-tauri/tauri.conf.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@
201201
"appimage",
202202
"nsis",
203203
"app",
204-
"dmg",
205204
"updater"
206205
],
207206
"windows": {

0 commit comments

Comments
 (0)