mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-30 14:22:02 +00:00
- Added .automaker/images/ to .gitignore to prevent tracking of generated images. - Deleted obsolete agent-output.md and feature.json files related to removed "Agent Tools" feature. - Introduced a new script for uploading build artifacts to R2 and updating releases.json. - Enhanced GitHub Actions workflow to include artifact uploads for different platforms.
140 lines
4.0 KiB
YAML
140 lines
4.0 KiB
YAML
name: Build and Release Electron App
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*.*.*" # Triggers on version tags like v1.0.0
|
|
workflow_dispatch: # Allows manual triggering
|
|
inputs:
|
|
version:
|
|
description: "Version to release (e.g., v1.0.0)"
|
|
required: true
|
|
default: "v0.1.0"
|
|
|
|
jobs:
|
|
build-and-release:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- os: macos-latest
|
|
name: macOS
|
|
artifact-name: macos-builds
|
|
- os: windows-latest
|
|
name: Windows
|
|
artifact-name: windows-builds
|
|
- os: ubuntu-latest
|
|
name: Linux
|
|
artifact-name: linux-builds
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "20"
|
|
cache: "npm"
|
|
cache-dependency-path: package-lock.json
|
|
|
|
- name: Install dependencies
|
|
# Use npm install instead of npm ci to correctly resolve platform-specific
|
|
# optional dependencies (e.g., @tailwindcss/oxide, lightningcss binaries)
|
|
run: npm install
|
|
|
|
- name: Build Electron App (macOS)
|
|
if: matrix.os == 'macos-latest'
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: npm run build:electron -- --mac --x64 --arm64
|
|
|
|
- name: Build Electron App (Windows)
|
|
if: matrix.os == 'windows-latest'
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: npm run build:electron -- --win --x64
|
|
|
|
- name: Build Electron App (Linux)
|
|
if: matrix.os == 'ubuntu-latest'
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: npm run build:electron -- --linux --x64
|
|
|
|
- name: Upload Release Assets
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
tag_name: ${{ github.event.inputs.version || github.ref_name }}
|
|
files: |
|
|
apps/app/dist/*.exe
|
|
apps/app/dist/*.dmg
|
|
apps/app/dist/*.AppImage
|
|
apps/app/dist/*.zip
|
|
apps/app/dist/*.deb
|
|
apps/app/dist/*.rpm
|
|
draft: false
|
|
prerelease: false
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Upload macOS artifacts for R2
|
|
if: matrix.os == 'macos-latest'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.artifact-name }}
|
|
path: apps/app/dist/*.dmg
|
|
retention-days: 1
|
|
|
|
- name: Upload Windows artifacts for R2
|
|
if: matrix.os == 'windows-latest'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.artifact-name }}
|
|
path: apps/app/dist/*.exe
|
|
retention-days: 1
|
|
|
|
- name: Upload Linux artifacts for R2
|
|
if: matrix.os == 'ubuntu-latest'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.artifact-name }}
|
|
path: apps/app/dist/*.AppImage
|
|
retention-days: 1
|
|
|
|
upload-to-r2:
|
|
needs: build-and-release
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "20"
|
|
|
|
- name: Download all artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: artifacts
|
|
|
|
- name: Install AWS SDK
|
|
run: npm install @aws-sdk/client-s3
|
|
|
|
- name: Upload to R2 and update releases.json
|
|
env:
|
|
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_NAME: ${{ secrets.R2_BUCKET_NAME }}
|
|
R2_PUBLIC_URL: ${{ secrets.R2_PUBLIC_URL }}
|
|
RELEASE_VERSION: ${{ github.event.inputs.version || github.ref_name }}
|
|
GITHUB_REPOSITORY: ${{ github.repository }}
|
|
run: node .github/scripts/upload-to-r2.js
|