85 lines
2.4 KiB
YAML
85 lines
2.4 KiB
YAML
name: release
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
package:
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- os: windows-2025
|
|
artifact_name: clice.7z
|
|
asset_name: clice-x64-windows-msvc.7z
|
|
toolchain: clang
|
|
|
|
- os: ubuntu-22.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: Upload binaries to release
|
|
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
|