|
| 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