Skip to content

Commit b651e0f

Browse files
Extract upload-agnostic-assets
1 parent 9107ec7 commit b651e0f

2 files changed

Lines changed: 97 additions & 34 deletions

File tree

.github/workflows/build.yaml

Lines changed: 8 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -83,37 +83,11 @@ jobs:
8383
with:
8484
releaseId: ${{ needs.create-release.outputs.release_id }}
8585

86-
- name: Upload version-agnostic assets
87-
env:
88-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89-
shell: bash
90-
run: |
91-
# Extract version from tag (remove 'v' prefix)
92-
VERSION="${GITHUB_REF#refs/tags/v}"
93-
94-
# Find and upload version-agnostic copies of release assets
95-
cd src-tauri/target/release/bundle
96-
97-
# Windows: .exe installer
98-
if [ -f "nsis/Cubeast.Connect_${VERSION}_x64-setup.exe" ]; then
99-
echo "Creating version-agnostic Windows installer..."
100-
cp "nsis/Cubeast.Connect_${VERSION}_x64-setup.exe" "Cubeast.Connect_x64-setup.exe"
101-
gh release upload "${{ github.ref_name }}" "Cubeast.Connect_x64-setup.exe" --clobber
102-
echo "✓ Uploaded Cubeast.Connect_x64-setup.exe"
103-
fi
104-
105-
# macOS: .dmg (Apple Silicon)
106-
if [ -f "dmg/Cubeast.Connect_${VERSION}_aarch64.dmg" ]; then
107-
echo "Creating version-agnostic macOS installer..."
108-
cp "dmg/Cubeast.Connect_${VERSION}_aarch64.dmg" "Cubeast.Connect_aarch64.dmg"
109-
gh release upload "${{ github.ref_name }}" "Cubeast.Connect_aarch64.dmg" --clobber
110-
echo "✓ Uploaded Cubeast.Connect_aarch64.dmg"
111-
fi
112-
113-
# Linux: .AppImage
114-
if [ -f "appimage/Cubeast.Connect_${VERSION}_amd64.AppImage" ]; then
115-
echo "Creating version-agnostic Linux installer..."
116-
cp "appimage/Cubeast.Connect_${VERSION}_amd64.AppImage" "Cubeast.Connect_amd64.AppImage"
117-
gh release upload "${{ github.ref_name }}" "Cubeast.Connect_amd64.AppImage" --clobber
118-
echo "✓ Uploaded Cubeast.Connect_amd64.AppImage"
119-
fi
86+
upload-agnostic-assets:
87+
if: startsWith(github.ref, 'refs/tags/')
88+
needs: build
89+
permissions:
90+
contents: write
91+
uses: ./.github/workflows/upload-agnostic-assets.yml
92+
with:
93+
tag: ${{ github.ref_name }}
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: 'Upload Version-Agnostic Assets'
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: 'Release tag (e.g., v0.7.1)'
8+
required: true
9+
type: string
10+
workflow_call:
11+
inputs:
12+
tag:
13+
description: 'Release tag (e.g., v0.7.1)'
14+
required: true
15+
type: string
16+
17+
jobs:
18+
upload:
19+
runs-on: ubuntu-24.04
20+
permissions:
21+
contents: write
22+
steps:
23+
- name: Download release assets
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
run: |
27+
TAG="${{ inputs.tag }}"
28+
VERSION="${TAG#v}"
29+
echo "Processing tag: $TAG (version: $VERSION)"
30+
31+
# Create temp directory
32+
mkdir -p temp_assets
33+
cd temp_assets
34+
35+
# Download all assets from the release
36+
gh release download "$TAG" --repo ${{ github.repository }}
37+
38+
echo "Downloaded files:"
39+
ls -lh
40+
41+
# Windows: .exe installer
42+
if [ -f "Cubeast.Connect_${VERSION}_x64-setup.exe" ]; then
43+
echo "Creating version-agnostic Windows installer..."
44+
cp "Cubeast.Connect_${VERSION}_x64-setup.exe" "Cubeast.Connect_x64-setup.exe"
45+
gh release upload "$TAG" "Cubeast.Connect_x64-setup.exe" --repo ${{ github.repository }} --clobber
46+
echo "✓ Uploaded Cubeast.Connect_x64-setup.exe"
47+
else
48+
echo "⚠ Windows installer not found: Cubeast.Connect_${VERSION}_x64-setup.exe"
49+
fi
50+
51+
# Windows: .msi installer
52+
if [ -f "Cubeast.Connect_${VERSION}_x64_en-US.msi" ]; then
53+
echo "Creating version-agnostic Windows MSI installer..."
54+
cp "Cubeast.Connect_${VERSION}_x64_en-US.msi" "Cubeast.Connect_x64_en-US.msi"
55+
gh release upload "$TAG" "Cubeast.Connect_x64_en-US.msi" --repo ${{ github.repository }} --clobber
56+
echo "✓ Uploaded Cubeast.Connect_x64_en-US.msi"
57+
else
58+
echo "⚠ Windows MSI installer not found: Cubeast.Connect_${VERSION}_x64_en-US.msi"
59+
fi
60+
61+
# macOS: .dmg (Apple Silicon)
62+
if [ -f "Cubeast.Connect_${VERSION}_aarch64.dmg" ]; then
63+
echo "Creating version-agnostic macOS installer..."
64+
cp "Cubeast.Connect_${VERSION}_aarch64.dmg" "Cubeast.Connect_aarch64.dmg"
65+
gh release upload "$TAG" "Cubeast.Connect_aarch64.dmg" --repo ${{ github.repository }} --clobber
66+
echo "✓ Uploaded Cubeast.Connect_aarch64.dmg"
67+
else
68+
echo "⚠ macOS installer not found: Cubeast.Connect_${VERSION}_aarch64.dmg"
69+
fi
70+
71+
# Linux: .AppImage
72+
if [ -f "cubeast-connect_${VERSION}_amd64.AppImage" ]; then
73+
echo "Creating version-agnostic Linux installer..."
74+
cp "cubeast-connect_${VERSION}_amd64.AppImage" "cubeast-connect_amd64.AppImage"
75+
gh release upload "$TAG" "cubeast-connect_amd64.AppImage" --repo ${{ github.repository }} --clobber
76+
echo "✓ Uploaded cubeast-connect_amd64.AppImage"
77+
else
78+
echo "⚠ Linux installer not found: cubeast-connect_${VERSION}_amd64.AppImage"
79+
fi
80+
81+
# Linux: .deb
82+
if [ -f "cubeast-connect_${VERSION}_amd64.deb" ]; then
83+
echo "Creating version-agnostic Linux deb package..."
84+
cp "cubeast-connect_${VERSION}_amd64.deb" "cubeast-connect_amd64.deb"
85+
gh release upload "$TAG" "cubeast-connect_amd64.deb" --repo ${{ github.repository }} --clobber
86+
echo "✓ Uploaded cubeast-connect_amd64.deb"
87+
else
88+
echo "⚠ Linux deb package not found: cubeast-connect_${VERSION}_amd64.deb"
89+
fi

0 commit comments

Comments
 (0)