diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c8a40462..524dba2a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,6 +11,7 @@ env: ELECTRON_OUTPUT_PATH: ./dist_electron CSC_LINK: ${{ secrets.BUILD_CERTIFICATE_BASE64 }} CSC_KEY_PASSWORD: ${{ secrets.P12_PASSWORD }} + USE_HARD_LINKS: false jobs: release: @@ -21,7 +22,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-13, windows-latest] + os: [ubuntu-latest, macos-13, windows-latest, windows-11-arm] steps: @@ -73,6 +74,22 @@ jobs: yarn yarn global add xvfb-maybe + - name: Modify electron-builder.json for Windows x64 + if: matrix.os == 'windows-latest' + run: | + # Remove arm64 from the arch array, keep only x64 + $config = Get-Content electron-builder.json | ConvertFrom-Json + $config.win.target[0].arch = @("x64", "ia32") + $config | ConvertTo-Json -Depth 10 | Set-Content electron-builder.json + + - name: Modify electron-builder.json for Windows ARM64 + if: matrix.os == 'windows-11-arm' + run: | + # Remove x64 from the arch array, keep only arm64 + $config = Get-Content electron-builder.json | ConvertFrom-Json + $config.win.target[0].arch = @("arm64") + $config | ConvertTo-Json -Depth 10 | Set-Content electron-builder.json + - name: Build & release app run: | yarn release @@ -92,3 +109,85 @@ jobs: P12_PASSWORD: ${{ secrets.P12_PASSWORD }} BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }} KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} + USE_HARD_LINKS: false + + - name: Upload Windows x64 executables + if: matrix.os == 'windows-latest' + uses: actions/upload-artifact@v4 + with: + name: windows-x64-executables + path: | + dist_electron/* + retention-days: 30 + if-no-files-found: error + + - name: Upload Windows ARM64 executables + if: matrix.os == 'windows-11-arm' + uses: actions/upload-artifact@v4 + with: + name: windows-arm64-executables + path: | + dist_electron/* + retention-days: 30 + if-no-files-found: error + + - name: Upload macOS packages + if: matrix.os == 'macos-13' + uses: actions/upload-artifact@v4 + with: + name: macos-packages + path: | + dist_electron/* + retention-days: 30 + if-no-files-found: error + + - name: Upload Linux packages + if: matrix.os == 'ubuntu-latest' + uses: actions/upload-artifact@v4 + with: + name: linux-packages + path: | + dist_electron/* + retention-days: 30 + if-no-files-found: ignore + + - name: Upload Windows x64 yml + if: matrix.os == 'windows-latest' + uses: actions/upload-artifact@v4 + with: + name: windows-x64-yml + path: | + dist_electron/github/* + retention-days: 30 + if-no-files-found: error + + - name: Upload Windows ARM64 yml + if: matrix.os == 'windows-11-arm' + uses: actions/upload-artifact@v4 + with: + name: windows-arm64-yml + path: | + dist_electron/github/* + retention-days: 30 + if-no-files-found: error + + - name: Upload macOS yml + if: matrix.os == 'macos-13' + uses: actions/upload-artifact@v4 + with: + name: macos-yml + path: | + dist_electron/github/* + retention-days: 30 + if-no-files-found: error + + - name: Upload Linux yml + if: matrix.os == 'ubuntu-latest' + uses: actions/upload-artifact@v4 + with: + name: linux-yml + path: | + dist_electron/github/* + retention-days: 30 + if-no-files-found: ignore + diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 9a26a4c1..3ce41b41 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -73,7 +73,7 @@ jobs: run: | # Remove arm64 from the arch array, keep only x64 $config = Get-Content electron-builder.json | ConvertFrom-Json - $config.win.target[0].arch = @("x64") + $config.win.target[0].arch = @("x64", "ia32") $config | ConvertTo-Json -Depth 10 | Set-Content electron-builder.json - name: Modify electron-builder.json for Windows ARM64 @@ -123,7 +123,7 @@ jobs: with: name: windows-x64-executables path: | - dist_electron/PicList-Setup-*.exe + dist_electron/* retention-days: 30 if-no-files-found: error @@ -137,23 +137,62 @@ jobs: retention-days: 30 if-no-files-found: error - - name: Upload macOS packages with original names + - name: Upload macOS packages if: matrix.os == 'macos-13' uses: actions/upload-artifact@v4 with: name: macos-packages path: | - dist_electron/PicList-*.dmg + dist_electron/* retention-days: 30 if-no-files-found: error - - name: Upload Linux packages with original names + - name: Upload Linux packages if: matrix.os == 'ubuntu-latest' uses: actions/upload-artifact@v4 with: name: linux-packages path: | - dist_electron/PicList-*.AppImage - dist_electron/*.snap + dist_electron/* + retention-days: 30 + if-no-files-found: ignore + + - name: Upload Windows x64 yml + if: matrix.os == 'windows-latest' + uses: actions/upload-artifact@v4 + with: + name: windows-x64-yml + path: | + dist_electron/github/* + retention-days: 30 + if-no-files-found: error + + - name: Upload Windows ARM64 yml + if: matrix.os == 'windows-11-arm' + uses: actions/upload-artifact@v4 + with: + name: windows-arm64-yml + path: | + dist_electron/github/* + retention-days: 30 + if-no-files-found: error + + - name: Upload macOS yml + if: matrix.os == 'macos-13' + uses: actions/upload-artifact@v4 + with: + name: macos-yml + path: | + dist_electron/github/* + retention-days: 30 + if-no-files-found: error + + - name: Upload Linux yml + if: matrix.os == 'ubuntu-latest' + uses: actions/upload-artifact@v4 + with: + name: linux-yml + path: | + dist_electron/github/* retention-days: 30 if-no-files-found: ignore diff --git a/electron-builder.json b/electron-builder.json index 6f40476a..e437f38d 100644 --- a/electron-builder.json +++ b/electron-builder.json @@ -67,7 +67,7 @@ "target": [ { "target": "nsis", - "arch": ["x64", "arm64"] + "arch": ["x64", "ia32", "arm64"] } ] }, diff --git a/scripts/upload-dist-to-r2.cjs b/scripts/upload-dist-to-r2.cjs index bbe3b262..7b289b6c 100644 --- a/scripts/upload-dist-to-r2.cjs +++ b/scripts/upload-dist-to-r2.cjs @@ -47,7 +47,7 @@ const uploadFile = async () => { console.warn('platform not supported!', platform) return } - let versionFileHasUploaded = false + let versionFileHasUploaded = true for (const [index, config] of configList[platform].entries()) { const fileName = `${config.appNameWithPrefix}${VERSION}${config.arch}${config.ext}` const distPath = path.join(__dirname, '../dist_electron')