Files
MeshChatX/.github/workflows/build-release.yml

117 lines
4.2 KiB
YAML

# Tagged releases: Windows + macOS builds (same idea as .gitea/workflows/build.yml — any tag
# points at a commit; no requirement that the tag be on master).
#
# Pinned first-party actions (bump tag and SHA together when upgrading):
# actions/checkout@v6.0.1 8e8c483db84b4bee98b60c0593521ed34d9990e8
# actions/setup-python@v6.2.0 a309ff8b426b58ec0e2a45f0f869d46889d02405
# actions/setup-node@v6.1.0 395ad3262231945c25e8478fd5baf05154b1d79f
# actions/upload-artifact@v5.0.0 330a01c490aca151604b8cf639adc76d48f6c5d4
name: Build release
on:
push:
tags:
- "*"
workflow_dispatch:
permissions:
contents: read
actions: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
NODE_OPTIONS: --max-old-space-size=8192
PYTHON_VERSION: "3.14"
NODE_VERSION: "24"
POETRY_VERSION: "2.1.1"
PNPM_VERSION: "10.32.1"
jobs:
build-release:
name: Build release (${{ matrix.label }})
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
label: windows
timeout: 120
build_script: scripts/ci/github-build-windows.sh
artifact_prefix: meshchatx-windows
- os: macos-latest
label: macos
timeout: 180
build_script: scripts/ci/github-build-macos.sh
artifact_prefix: meshchatx-macos
runs-on: ${{ matrix.os }}
timeout-minutes: ${{ matrix.timeout }}
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Poetry (PyPI pin)
env:
POETRY_VERSION: ${{ env.POETRY_VERSION }}
run: bash scripts/ci/github-install-poetry.sh
- name: Set up Node
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f
with:
node-version: ${{ env.NODE_VERSION }}
- name: Enable pnpm (corepack)
run: corepack enable && corepack prepare "pnpm@${PNPM_VERSION}" --activate
- name: Install dependencies
run: bash scripts/ci/github-install-deps.sh
- name: Install Rosetta (Apple Silicon)
if: matrix.label == 'macos'
run: /usr/sbin/softwareupdate --install-rosetta --agree-to-license || true
- name: Set up Python x64 for cx_Freeze universal slice
id: python_x64
if: matrix.label == 'macos'
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: ${{ env.PYTHON_VERSION }}
architecture: x64
update-environment: false
- name: Export PYTHON_CMD_X64 for mac universal build
if: matrix.label == 'macos'
run: echo "PYTHON_CMD_X64=${{ steps.python_x64.outputs.python-path }}" >> "$GITHUB_ENV"
- name: Install project deps into x64 Python (mac universal cx_Freeze)
if: matrix.label == 'macos'
env:
PY_X64: ${{ steps.python_x64.outputs.python-path }}
run: |
set -euo pipefail
"$PY_X64" -m pip install -U pip setuptools wheel
"$PY_X64" -m pip install "cx-freeze>=7.0.0"
"$PY_X64" -m pip install -e .
- name: Build distributables
run: bash "${{ matrix.build_script }}"
- name: Upload dist artifacts
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
with:
name: ${{ matrix.artifact_prefix }}-${{ github.ref_name }}-${{ github.run_id }}
path: dist/
if-no-files-found: warn