Files
clice/.github/workflows/release.yml
ykiko a10908d3d9 Fix release ci (#282)
Co-authored-by: star9029 <hengxings783@gmail.com>
2025-10-20 21:43:46 +08:00

97 lines
2.7 KiB
YAML

name: release
permissions:
contents: write
on:
push:
tags:
- "v*"
pull_request:
branches: [main]
paths:
- ".github/workflows/release.yml"
jobs:
package:
strategy:
matrix:
include:
- os: windows-2025
artifact_name: clice.7z
asset_name: clice-x64-windows-msvc.7z
toolchain: clang-cl
- os: ubuntu-24.04
artifact_name: clice.tar.xz
asset_name: clice-x86_64-linux-gnu.tar.xz
toolchain: clang-20
- os: macos-15
artifact_name: clice.tar.xz
asset_name: clice-arm64-macos-darwin.tar.xz
toolchain: clang
runs-on: ${{ matrix.os }}
steps:
- name: Setup llvm & libstdc++ & cmake & ninja
if: matrix.os == 'ubuntu-24.04'
run: |
sudo apt remove llvm-16-linker-tools llvm-16 llvm-17-linker-tools llvm-17 llvm-18-linker-tools llvm-18
sudo apt update
sudo apt install -y gcc-14 g++-14 libstdc++-14-dev cmake ninja-build
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100
sudo update-alternatives --set gcc /usr/bin/gcc-14
sudo update-alternatives --set g++ /usr/bin/g++-14
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 20 all
- name: Setup llvm@20
if: matrix.os == 'macos-15'
run: |
brew install llvm@20
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup xmake
uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: branch@master
actions-cache-folder: ".xmake-cache"
actions-cache-key: ${{ matrix.os }}
- name: Package
if: matrix.os != 'macos-15'
run: |
xmake config --yes --toolchain=${{ matrix.toolchain }} --enable_test=n --dev=n --release=y
xmake pack
- name: Package
if: matrix.os == 'macos-15'
run: |
xmake config --yes --toolchain=${{ matrix.toolchain }} --sdk=/opt/homebrew/opt/llvm@20 --enable_test=n --dev=n --release=y
xmake pack
- name: Install uv for integration tests
uses: astral-sh/setup-uv@v6
- name: Run tests
run: xmake test --verbose
- name: Upload binaries to release
if: github.event_name == 'push'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/xpack/clice/${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}
overwrite: true