From 257eb03528afcd6c3af4a23084d7a2ee3b3a57a0 Mon Sep 17 00:00:00 2001 From: Samidy Date: Sat, 14 Feb 2026 22:44:53 +0300 Subject: [PATCH] update workflow to auto push to R2 on build --- .github/workflows/desktop-build.yml | 60 ++++++++++++++--------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/.github/workflows/desktop-build.yml b/.github/workflows/desktop-build.yml index 3f44b1c..5a122ff 100644 --- a/.github/workflows/desktop-build.yml +++ b/.github/workflows/desktop-build.yml @@ -19,17 +19,17 @@ jobs: platform: windows binary_source: Monochrome-win_x64.exe binary_dest: Monochrome.exe - archive_ext: zip + archive_name: monochrome-windows.zip - os: ubuntu-latest platform: linux binary_source: Monochrome-linux_x64 binary_dest: Monochrome - archive_ext: tar.gz + archive_name: monochrome-linux.zip - os: macos-latest platform: macos binary_source: Monochrome-mac_universal binary_dest: Monochrome - archive_ext: tar.gz + archive_name: monochrome-mac.zip steps: - name: Checkout code @@ -51,12 +51,11 @@ jobs: - name: Build application run: bun run build - - name: Prepare Release + - name: Prepare Release Folder run: | mkdir release cp dist/Monochrome/resources.neu release/ cp neutralino.config.json release/ - # Extensions are already copied to dist/Monochrome/extensions by postbuild cp -r dist/Monochrome/extensions release/ cp dist/Monochrome/${{ matrix.binary_source }} release/${{ matrix.binary_dest }} shell: bash @@ -65,32 +64,33 @@ jobs: if: matrix.platform != 'windows' run: chmod +x release/${{ matrix.binary_dest }} - # Upload the uncompressed directory as the workflow artifact. - # GitHub will zip this automatically when downloaded, avoiding "zip inside zip". - - name: Upload Artifact + + - name: Zip for R2 (Windows) + if: matrix.platform == 'windows' + run: Compress-Archive -Path release/* -DestinationPath ${{ matrix.archive_name }} -Force + shell: pwsh + + - name: Zip for R2 (Linux/macOS) + if: matrix.platform != 'windows' + run: | + cd release + zip -r ../${{ matrix.archive_name }} . + shell: bash + + - name: Upload to R2 + uses: ryand56/r2-upload-action@latest + with: + r2-account-id: ${{ secrets.R2_ACCOUNT_ID }} + r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }} + r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }} + r2-bucket: ${{ secrets.R2_BUCKET }} + source-dir: '.' + include: '${{ matrix.archive_name }}' + destination-dir: '' + + - name: Upload Artifact (GH Internal) uses: actions/upload-artifact@v4 with: name: Monochrome-${{ matrix.platform }} path: release/ - retention-days: 30 - - # Create an archive specifically for the GitHub Release (tags only) - - name: Create Release Archive (Windows) - if: startsWith(github.ref, 'refs/tags/v') && matrix.platform == 'windows' - run: | - Compress-Archive -Path release/* -DestinationPath monochrome-${{ matrix.platform }}-x64.zip - shell: pwsh - - - name: Create Release Archive (Linux/macOS) - if: startsWith(github.ref, 'refs/tags/v') && matrix.platform != 'windows' - run: | - cd release - tar -czf ../monochrome-${{ matrix.platform }}-x64.tar.gz * - - - name: Create Release - if: startsWith(github.ref, 'refs/tags/v') - uses: softprops/action-gh-release@v1 - with: - files: monochrome-${{ matrix.platform }}-x64.${{ matrix.archive_ext }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + retention-days: 30 \ No newline at end of file