Support packaging for project release #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: nightly | |
permissions: | |
contents: write | |
on: | |
push: | |
branches: [ main ] | |
# test, remove it later | |
pull_request: | |
branches: [ main ] | |
jobs: | |
package: | |
strategy: | |
matrix: | |
include: | |
- os: windows-2022 | |
artifact_name: clice.7z | |
asset_name: clice-x64-windows-msvc.7z | |
toolchain: clang | |
- os: ubuntu-24.04 | |
artifact_name: clice.tar.xz | |
asset_name: clice-x86_64-linux-gnu.tar.xz | |
toolchain: clang-20 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Setup llvm | |
if: matrix.os == 'windows-2022' | |
uses: MinoruSekine/[email protected] | |
with: | |
buckets: main | |
apps: llvm | |
- 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 | |
sudo update-alternatives --install /usr/bin/ar ar /usr/lib/llvm-20/bin/llvm-ar 20 | |
sudo update-alternatives --install /usr/bin/ranlib ranlib /usr/lib/llvm-20/bin/llvm-ranlib 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 | |
run: | | |
xmake config --yes -vD --toolchain=${{ matrix.toolchain }} --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: nightly | |
overwrite: true |