Skip to content

リリース用のactionを追加 (#20) #1

リリース用のactionを追加 (#20)

リリース用のactionを追加 (#20) #1

Workflow file for this run

name: Release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
build-tauri:
strategy:
fail-fast: false
matrix:
platform:
[
macos-latest,
ubuntu-22.04,
windows-latest,
"ubuntu-22.04-arm",
"windows-11-arm",
]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
# For macOS universal builds
targets: aarch64-apple-darwin,x86_64-apple-darwin
- name: Install dependencies (Ubuntu)
if: startsWith(matrix.platform, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf jq
- name: Download and set up voicevox_core
shell: bash
run: |
# Determine OS and Arch for downloader
if [[ "${{ runner.os }}" == "Linux" ]]; then
OS="linux"
elif [[ "${{ runner.os }}" == "macOS" ]]; then
OS="macos"
elif [[ "${{ runner.os }}" == "Windows" ]]; then
OS="windows"
fi
if [[ "${{ runner.arch }}" == "X64" ]]; then
ARCH="x64"
elif [[ "${{ runner.arch }}" == "ARM64" ]]; then
ARCH="arm64"
else
echo "Unsupported architecture: ${{ runner.arch }}"
exit 1
fi
DOWNLOADER_NAME="download-${OS}-${ARCH}"
if [[ "${{ runner.os }}" == "Windows" ]]; then
DOWNLOADER_NAME="${DOWNLOADER_NAME}.exe"
fi
echo "Downloading ${DOWNLOADER_NAME}..."
LATEST_RELEASE_URL=$(curl -s https://api.github.com/repos/VOICEVOX/voicevox_core/releases/latest | jq -r ".assets[] | select(.name == \"${DOWNLOADER_NAME}\") | .browser_download_url")
if [ -z "$LATEST_RELEASE_URL" ] || [ "$LATEST_RELEASE_URL" == "null" ]; then
echo "Could not find downloader URL for ${DOWNLOADER_NAME}"
exit 1
fi
curl -L -o download "$LATEST_RELEASE_URL"
if [[ "${{ runner.os }}" != "Windows" ]]; then
chmod +x download
fi
# Run downloader
./download --exclude c-api
# Move files to the correct location
mv voicevox_core crates/tauri_app/
- name: Install frontend dependencies
run: npm install --prefix packages/ui
- name: Build with Tauri
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Disables update check for tauri-cli
TAURI_CLI_NO_UPDATE_NOTIFIER: 1
with:
tagName: ${{ github.ref_name }}
releaseName: "v__VERSION__"
releaseBody: "See the assets to download this version and install."
releaseDraft: true
prerelease: false
projectPath: "crates/tauri_app"