mirror of
https://github.com/m1ngsama/TUT.git
synced 2025-12-24 10:51:46 +00:00
- Remove redundant comments for cleaner code - Simplify error messages and status display - Improve code consistency across modules - Fix GitHub Actions workflow binary names - Enhance .gitignore for common editor files - Align help text formatting - Remove unnecessary verbose comments
97 lines
2.2 KiB
YAML
97 lines
2.2 KiB
YAML
name: Build and Release
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- os: macos-latest
|
|
name: macos
|
|
- os: ubuntu-latest
|
|
name: linux
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install dependencies (macOS)
|
|
if: matrix.os == 'macos-latest'
|
|
run: |
|
|
brew update
|
|
brew install cmake ncurses curl
|
|
|
|
- name: Install dependencies (Linux)
|
|
if: matrix.os == 'ubuntu-latest'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y cmake libncursesw5-dev libcurl4-openssl-dev
|
|
|
|
- name: Configure CMake
|
|
run: |
|
|
mkdir -p build
|
|
cd build
|
|
cmake ..
|
|
|
|
- name: Build project
|
|
run: |
|
|
cd build
|
|
cmake --build .
|
|
|
|
- name: Rename binary with platform suffix
|
|
run: |
|
|
mv build/tut build/tut-${{ matrix.name }}
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: tut-${{ matrix.name }}
|
|
path: build/tut-${{ matrix.name }}
|
|
|
|
release:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Download all artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: artifacts
|
|
|
|
- name: Generate version
|
|
id: version
|
|
run: |
|
|
VERSION="v$(date +'%Y.%m.%d')-$(git rev-parse --short HEAD)"
|
|
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
|
|
|
|
- name: Create Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
tag_name: ${{ steps.version.outputs.VERSION }}
|
|
name: Release ${{ steps.version.outputs.VERSION }}
|
|
body: |
|
|
Automated release for commit ${{ github.sha }}
|
|
|
|
## Download
|
|
- **macOS**: `tut-macos`
|
|
- **Linux**: `tut-linux`
|
|
|
|
## Build from source
|
|
See the [README](https://github.com/${{ github.repository }}/blob/main/README.md) for build instructions.
|
|
files: |
|
|
artifacts/tut-macos/tut-macos
|
|
artifacts/tut-linux/tut-linux
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|