mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-30 06:12:03 +00:00
- Use explicit file patterns to exclude builder config/debug files (builder-*.yml, *.yaml) - Include blockmap files for efficient delta updates in auto-update scenarios - Ensure only production-ready artifacts are uploaded to GitHub releases This prevents accidental inclusion of builder configuration files in the release assets. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
117 lines
3.2 KiB
YAML
117 lines
3.2 KiB
YAML
name: Release Build
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Extract version from tag
|
|
id: version
|
|
shell: bash
|
|
run: |
|
|
# Remove 'v' prefix if present (e.g., "v1.2.3" -> "1.2.3")
|
|
VERSION="${{ github.event.release.tag_name }}"
|
|
VERSION="${VERSION#v}"
|
|
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
|
echo "Extracted version: ${VERSION}"
|
|
|
|
- name: Update package.json version
|
|
shell: bash
|
|
run: |
|
|
node apps/ui/scripts/update-version.mjs "${{ steps.version.outputs.version }}"
|
|
|
|
- name: Setup project
|
|
uses: ./.github/actions/setup-project
|
|
with:
|
|
check-lockfile: 'true'
|
|
|
|
- name: Install RPM build tools (Linux)
|
|
if: matrix.os == 'ubuntu-latest'
|
|
shell: bash
|
|
run: sudo apt-get update && sudo apt-get install -y rpm
|
|
|
|
- name: Build Electron app (macOS)
|
|
if: matrix.os == 'macos-latest'
|
|
shell: bash
|
|
run: npm run build:electron:mac --workspace=apps/ui
|
|
env:
|
|
CSC_IDENTITY_AUTO_DISCOVERY: false
|
|
|
|
- name: Build Electron app (Windows)
|
|
if: matrix.os == 'windows-latest'
|
|
shell: bash
|
|
run: npm run build:electron:win --workspace=apps/ui
|
|
|
|
- name: Build Electron app (Linux)
|
|
if: matrix.os == 'ubuntu-latest'
|
|
shell: bash
|
|
run: npm run build:electron:linux --workspace=apps/ui
|
|
|
|
- name: Upload macOS artifacts
|
|
if: matrix.os == 'macos-latest'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: macos-builds
|
|
path: apps/ui/release/*.{dmg,zip}
|
|
retention-days: 30
|
|
|
|
- name: Upload Windows artifacts
|
|
if: matrix.os == 'windows-latest'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: windows-builds
|
|
path: apps/ui/release/*.exe
|
|
retention-days: 30
|
|
|
|
- name: Upload Linux artifacts
|
|
if: matrix.os == 'ubuntu-latest'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: linux-builds
|
|
path: apps/ui/release/*.{AppImage,deb,rpm}
|
|
retention-days: 30
|
|
|
|
upload:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
if: github.event.release.draft == false
|
|
|
|
steps:
|
|
- name: Download macOS artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: macos-builds
|
|
path: artifacts/macos-builds
|
|
|
|
- name: Download Windows artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: windows-builds
|
|
path: artifacts/windows-builds
|
|
|
|
- name: Download Linux artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: linux-builds
|
|
path: artifacts/linux-builds
|
|
|
|
- name: Upload to GitHub Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: |
|
|
artifacts/macos-builds/*.{dmg,zip,blockmap}
|
|
artifacts/windows-builds/*.{exe,blockmap}
|
|
artifacts/linux-builds/*.{AppImage,deb,rpm,blockmap}
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|