update workflow to auto push to R2 on build
This commit is contained in:
parent
2b9c9b344c
commit
257eb03528
1 changed files with 30 additions and 30 deletions
60
.github/workflows/desktop-build.yml
vendored
60
.github/workflows/desktop-build.yml
vendored
|
|
@ -19,17 +19,17 @@ jobs:
|
||||||
platform: windows
|
platform: windows
|
||||||
binary_source: Monochrome-win_x64.exe
|
binary_source: Monochrome-win_x64.exe
|
||||||
binary_dest: Monochrome.exe
|
binary_dest: Monochrome.exe
|
||||||
archive_ext: zip
|
archive_name: monochrome-windows.zip
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
platform: linux
|
platform: linux
|
||||||
binary_source: Monochrome-linux_x64
|
binary_source: Monochrome-linux_x64
|
||||||
binary_dest: Monochrome
|
binary_dest: Monochrome
|
||||||
archive_ext: tar.gz
|
archive_name: monochrome-linux.zip
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
platform: macos
|
platform: macos
|
||||||
binary_source: Monochrome-mac_universal
|
binary_source: Monochrome-mac_universal
|
||||||
binary_dest: Monochrome
|
binary_dest: Monochrome
|
||||||
archive_ext: tar.gz
|
archive_name: monochrome-mac.zip
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
|
|
@ -51,12 +51,11 @@ jobs:
|
||||||
- name: Build application
|
- name: Build application
|
||||||
run: bun run build
|
run: bun run build
|
||||||
|
|
||||||
- name: Prepare Release
|
- name: Prepare Release Folder
|
||||||
run: |
|
run: |
|
||||||
mkdir release
|
mkdir release
|
||||||
cp dist/Monochrome/resources.neu release/
|
cp dist/Monochrome/resources.neu release/
|
||||||
cp neutralino.config.json release/
|
cp neutralino.config.json release/
|
||||||
# Extensions are already copied to dist/Monochrome/extensions by postbuild
|
|
||||||
cp -r dist/Monochrome/extensions release/
|
cp -r dist/Monochrome/extensions release/
|
||||||
cp dist/Monochrome/${{ matrix.binary_source }} release/${{ matrix.binary_dest }}
|
cp dist/Monochrome/${{ matrix.binary_source }} release/${{ matrix.binary_dest }}
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
@ -65,32 +64,33 @@ jobs:
|
||||||
if: matrix.platform != 'windows'
|
if: matrix.platform != 'windows'
|
||||||
run: chmod +x release/${{ matrix.binary_dest }}
|
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: Zip for R2 (Windows)
|
||||||
- name: Upload Artifact
|
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
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: Monochrome-${{ matrix.platform }}
|
name: Monochrome-${{ matrix.platform }}
|
||||||
path: release/
|
path: release/
|
||||||
retention-days: 30
|
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 }}
|
|
||||||
Loading…
Reference in a new issue