mirror of
https://github.com/YuzuZensai/VRC-Circle.git
synced 2026-09-13 19:08:52 +00:00
124 lines
2.6 KiB
YAML
124 lines
2.6 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
tags:
|
|
- "v*"
|
|
pull_request:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
check:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
check: [lint, typecheck, format]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v5
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v5
|
|
with:
|
|
node-version: 22
|
|
cache: pnpm
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Run ${{ matrix.check }}
|
|
run: pnpm ${{ matrix.check }}
|
|
|
|
build:
|
|
needs: check
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- os: windows-latest
|
|
platform: windows
|
|
build-script: build:win
|
|
- os: macos-latest
|
|
platform: macos
|
|
build-script: build:mac
|
|
- os: ubuntu-latest
|
|
platform: linux
|
|
build-script: build:linux
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v5
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v5
|
|
with:
|
|
node-version: 22
|
|
cache: pnpm
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Set artifact version
|
|
id: version
|
|
shell: bash
|
|
run: |
|
|
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
|
|
echo "value=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "value=${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
- name: Build
|
|
env:
|
|
BUILD_VERSION: ${{ steps.version.outputs.value }}
|
|
CSC_IDENTITY_AUTO_DISCOVERY: false
|
|
run: pnpm ${{ matrix.build-script }}
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: ${{ matrix.platform }}-${{ steps.version.outputs.value }}
|
|
path: |
|
|
dist/*.exe
|
|
dist/*.dmg
|
|
dist/*.AppImage
|
|
if-no-files-found: error
|
|
|
|
release:
|
|
needs: build
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- name: Download artifacts
|
|
uses: actions/download-artifact@v6
|
|
with:
|
|
path: dist
|
|
merge-multiple: true
|
|
|
|
- name: Create release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: |
|
|
dist/*.exe
|
|
dist/*.dmg
|
|
dist/*.AppImage
|
|
generate_release_notes: true
|