diff --git a/.github/workflows/build-vento.yml b/.github/workflows/build-vento.yml new file mode 100644 index 000000000..a4c05e16e --- /dev/null +++ b/.github/workflows/build-vento.yml @@ -0,0 +1,119 @@ +name: Build Vento + +on: + workflow_dispatch: + inputs: + tag_name: + description: 'Release tag (e.g., v1.0.0)' + required: true + release_name: + description: 'Release title (e.g., Vento v1.0.0)' + required: true + prerelease: + description: 'Is this a prerelease?' + required: false + default: false + type: boolean +jobs: + build-macos: + runs-on: macos-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '22' + cache: 'yarn' + + - name: Cache Electron Builder + uses: actions/cache@v3 + with: + path: | + ~/.cache/electron + ~/.cache/electron-builder + key: ${{ runner.os }}-electron-builder-${{ hashFiles('yarn.lock') }} + restore-keys: | + ${{ runner.os }}-electron-builder- + + - name: Install Yarn + run: npm install -g yarn + + - name: Install dependencies + run: yarn install --immutable + + - name: Build macOS App + run: yarn app-package + + - name: Create ZIP from DMG + run: | + mkdir -p upload-artifact + cd ../dist + zip -r $GITHUB_WORKSPACE/upload-artifact/Vento-macOS-arm64.zip Vento-*-arm64.dmg + + - name: Upload to GitHub Release + if: ${{ github.event_name == 'workflow_dispatch' }} + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ github.event.inputs.tag_name }} + name: ${{ github.event.inputs.release_name }} + prerelease: ${{ github.event.inputs.prerelease }} + files: upload-artifact/Vento-macOS-arm64.zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + build-windows: + runs-on: windows-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '22' + cache: 'yarn' + + - name: Cache Electron Builder + uses: actions/cache@v3 + with: + path: | + ~/.cache/electron + ~/.cache/electron-builder + key: ${{ runner.os }}-electron-builder-${{ hashFiles('yarn.lock') }} + restore-keys: | + ${{ runner.os }}-electron-builder- + + - name: Install Yarn + run: npm i -g yarn + + - name: Install dependencies + run: yarn install --immutable + + - name: Build Electron .exe + run: | + yarn app-package + dir ..\dist\win-unpacked + + - name: Copy project to win-unpacked and zip the app + run: | + # Copy project folder to ..\dist\win-unpacked\project + New-Item -ItemType Directory -Force -Path '..\dist\win-unpacked\project' + Copy-Item -Path * -Destination '..\dist\win-unpacked\project' -Recurse -Force + # Create upload-artifact and zip the win-unpacked folder + New-Item -ItemType Directory -Force -Path upload-artifact + Compress-Archive -Path '..\dist\win-unpacked\*' -DestinationPath 'upload-artifact/Vento_Windows.zip' + + - name: Upload to GitHub Release + if: ${{ github.event_name == 'workflow_dispatch' }} + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ github.event.inputs.tag_name }} + name: ${{ github.event.inputs.release_name }} + prerelease: ${{ github.event.inputs.prerelease }} + files: upload-artifact/Vento_Windows.zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/electron-builder.yml b/electron-builder.yml index 77583b575..4e35315ef 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -5,7 +5,7 @@ directories: output: ../dist mac: target: - - target: dir + - target: dmg arch: - arm64 hardenedRuntime: true @@ -36,4 +36,5 @@ files: - "!.gitignore" buildDependenciesFromSource: false npmRebuild: false -afterPack: ./scripts/afterPack.js \ No newline at end of file +afterPack: ./scripts/afterPack.js +publish: null \ No newline at end of file